Jump to content

Match URL not inside tag


amites

Recommended Posts

Hello,

 

I'm working on a script to auto parse URL's in text, I have the URL match working,

unfortunately it is parsing existing links and image links as well, anyone have some advice?

 

preg_match('/\\bhttps?:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]/i', $content)

 

I tried adding (!=") and it simply ignores the last character of the match, what I want it to do id ignore matches inside quotation marks "

 

any ideas are greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/126797-match-url-not-inside-tag/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.