php - RegEx - Match all URLs in string, excluding ones in <iframe> tag? -
i'm using mediaembed (https://github.com/dereuromark/mediaembed) convert media urls in string respective embed code, it's catching media urls within iframes (already embedded).
the expression i'm using match links is:
"~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~"
what need changed in order not match if url within iframe?
solution code:
'/(?<!=")(\b[\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/'
Comments
Post a Comment