The following regular expression found here matched the below domains just fine, but I don't want it to match a domain that is already in an anchor tag (the last example) Note that this matching will be detecting these cases in sentences of text.
((?: http| https)://)?[.0-9a-z-]+\.[a-z]{2,6}(?::[0-9]{1,5}+)?(?:/[!$'()*+,._a-z-]++){0,9}(?:/[!$'()*+,._a-z-]*)?(?:\?[!$&'()*+,.=_a-z-]*)?
Matches this in a sentence or paragraph:
www.domain.com
domain.com
this.is.a.special.url.domain.com/hello
http://domain.com
http://www.domain.com
http://www.domain.com/
http://www.domain.com/index.html
http://www.domain.com/index.html?source=library
BUT, how do I change the regex to not match the domain that is already in an anchor tag?
<a href="http://www.usertesting.com">hello</a>