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

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -