match - Regex .* not matching a lack of input -
hi have following regex statement:-
<a .* href="http://www.someurl/test.htm">.*?<\/a>
that matches following fine:-
<a class=op_web href="http://www.someurl.co.uk/test.htm">test</a>
however doesnt match when there nothing entered between opening 'a' tag , 'href' statement e.g.:-
<a href="http://www.someurl.co.uk/test.htm">test</a>
how rearrange statement can match @ between opening 'a' , 'href' including nothing @ all?
<a .* href="http://www.someurl/test.htm">.*?<\/a>
this because of spaces
after <a
.make
<a\b.*href="http:\/\/www\.someurl\.co\.uk\/test\.htm">.*?<\/a>
try
<a\b(?:(?!<\/a>).)*href="http:\/\/www\.someurl\.co\.uk\/test\.htm">(?:(?!<\/a>).)*<\/a>
see demo.
Comments
Post a Comment