Ok, so I know this question has been asked in different forms several times, but I am having trouble with specific syntax. I have a large string which contains html snippets. I need to find every link tag that does not already have a target= attribute (so that I can add one as needed).
^((?!target).)*
will give me text leading up to 'target', and <a.+?>[\w\W]+?</a>
will give me a link, but thats where I'm stuck. An example:
<a href="http://www.someSite.com>Link</a> (This should be a match)
<a href="SomeLink.whatever target="_blank">Link</a> (this should not be a match).
Any suggestions? Using DOM or XPATH are not really options since this snippet is not well-formed html.