I have the following multiline HTML:
<SPAN><INPUT id=notthisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Guinevere" href='BLOCKED SCRIPTPC_7("doclist" , "09006da78003h2jd" , "13"
<SPAN><INPUT id=thisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "09006da78003f2fd" , "13"
In this example there are two instances I am searching across - but there can be many more, e.g.
<SPAN><INPUT id=notthisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Guinevere" href='BLOCKED SCRIPTPC_7("doclist" , "09006da78003h2jd" , "13"
<SPAN><INPUT id=reallynotthisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "09006da78003f2fd" , "13"
<SPAN><INPUT id=thisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "09006da79123f2fd" , "13"
I need to be able to identify the ID of the INPUT tag that proceeds a given 0900 number. For example, if I have 09006da79123f2fd I want to get "thisone".
I've tried the following:
text =~ /INPUT id\=(.*?) onclick(.*?)09006da79123f2fd/m
But that returns the FIRST id - the regexp is matching EVERYTHING from the first "INPUT" through to the given 0900 number...it is matching:
notthisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Guinevere" href='BLOCKED SCRIPTPC_7("
doclist" , "09006da78003h2jd" , "13"
<SPAN><INPUT id=reallynotthisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "09006da78003f2fd" , "13"
<SPAN><INPUT id=thisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "
instead of:
thisone onclick=blah type=checkbox name=PC_71234
<TD class=really>
<DIV class=cell><SPAN=dir><A title="Sir Lancelot" href='BLOCKED SCRIPTPC_7("doclist" , "
Does anyone have any ideas what Im doing wrong? I am using the ruby regexp engine.