Can someone please advise what the correct pattern is to return the text between two search strings?
For example, in the html string below, I want to return the text between "selected>" and "<". In this example I want "NA".
I've tried using the lookahead/lookbehind;
(?<=selected>)(.*?)(?=<)
but it returns a syntax error in regular expression (5017).
I used Tushar Mehta's test website (http://www.tmehta.com/regexp/regexpfind.asp) as well as in VBA / Excel 2002 and get the same error.
For example, in the html string below, I want to return the text between "selected>" and "<". In this example I want "NA".
HTML:
"<SELECT class=nfinput name=pace0><OPTION value=L>L</OPTION><OPTION value=P>P</OPTION><OPTION value=OP>OP</OPTION><OPTION value=M>M</OPTION><OPTION value=OM>OM</OPTION><OPTION value=BK>BK</OPTION><OPTION value=NA selected>NA</OPTION><OPTION value=SCR>SCR</OPTION></SELECT>"
I've tried using the lookahead/lookbehind;
(?<=selected>)(.*?)(?=<)
but it returns a syntax error in regular expression (5017).
I used Tushar Mehta's test website (http://www.tmehta.com/regexp/regexpfind.asp) as well as in VBA / Excel 2002 and get the same error.