I have this regex:
<li><i>(?:<a.*?>)?(.*)(?:<.*?>)?</i></li>
Now, this should either match this text:
<li><i><a href="hello.htm">Hi there</a></i></li>
or without the <a>
tag, like so:
<li><i>42nd Street</i></li>
Without the <a>
tag, the regex works just fine, problem is, with the first example, I get this match:
Hi there</a>
I've read about ignoring grouping with (?:regex)
but I do not know why it insists on including the closing </a>
tag What regex would ignore the closing </a>
tag so I would only get Hi there?