in reply to Re: Re: Re: negative Lookahead
in thread negative Lookahead or

OK, thanks. Considering switching to greedy instead of non-greedy results in the regex
$string =~ / ( HIT (?= [^<]* (?! <a[^>]*> ) .*?<\/a> ) .*?<\/a> ) /x;
but still gives the same results. If the $string
'<a href="#1">--HIT<a name="MUST NOT MATCH">--</a> <a href="#2">2</a>'
does properly not match and
'<a href="#1">--HIT-<a name="MUST NOT MATCH">--</a> <a href="#2">2</a> +'
does "falsely" match I don't understand why the problem lies in the fact that a negative lookahead does not backtrack.