Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(((url\()|((href|src)=))(\s*["']?\s*))(?!((["']?)(http|https|ftp|ftps):\/\/)|["']?(\/))
/
ig

Description

this covers all scenarios apart from url that start with / and not //

Submitted by anonymous - 4 years ago