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.

http://regex101.com/r/lz5mn8/66


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -