List Info

Thread: Search URL's in HTML - but NOT in tags




Search URL's in HTML - but NOT in tags
user name
2006-09-14 16:37:07

> By the way this is a better HTMLstring for testing:
> <p>This a <a href="http://www.test.com">
;test</a>:<br />This URL
> www.second.test.com may match because it has to be a
clickable link.
> This is a URL between tags
<em>www.third.test.com</em>.<br />This
regex
> also finds emailaddress.es.</p>

try this regex vs the above input:

(?<!href="|//)(https?|file|www|ftp).*\.\w+

u sh'have 2 matches:

www.second.test.com

www.third.test.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )