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 -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -