I want to match any URL that isn't already enclosed in an href. i.e I want to ignore the following.
<a href="http://www.test.com/whatever">
I'm trying to write a regex to automatically find urls, so that I can turn them into marked up a hrefs.
The issue I'm having is dealing with urls that have already开发者_运维问答 been marked up (The documents contain a mix of marked up and not marked up urls).
Use negative look ahead to see if an url does NOT have </a>
ahead of it
your_regex(?!\s*</a>)
精彩评论