Martin C 6 Posted April 2, 2012 Report Share Posted April 2, 2012 I have a scraped text that is <h3 class="r"><a href="http://www.domain.com/article/insurance" class="l" onmousedown="return rwt(this,'','','','21','AFQjCNH5_Du8GKgqimnlXXL18fnyNWNi2Q','','0CHMQFjAAOBQ',null,event)"><em>insurance</em> - <em>best deals</em> <b>...</b></a></h3> I want to extract whatever the number is which in the above example is '21', but it could be any number from 1 to 100. I don't know what will be in the previous 3 parameters i.e. ,'','','', it could be ,'13','9','something' or even ,'text','text','100'For the above example I can isolate the parameter I need using ('\d{1,3}') but that will only work if the first three parameters are going to remain empty, or if they have values that are not numbers. Is there a way that I can get the Reg expression to skip to the 4th comma before searching? Is there a better way to do this? Or is this not a suitable use of Reg expression? Any advice would be appreciated Best regards Martin Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.