Hello All,
I'm trying to do some HTML parsing using Regx, but I'm having some issues with my expression. I'm trying to match something like this:
[HTML]<option value="1">Women 's 6
<option value="2">Women 's 6.5[/HTML]
My expression looks like this:
[PHP]$msg_patt = "/<option value=\"(.*?)\" >([A-Za-z]+'[A-Za-z]{1} [0-9]+([\.0-9]{2})?)\n/";[/PHP]
Using preg_match_all the above expression matches both of the options (women's 6 and women's 6.5).
How can I change my expression so that it would match only Women's 6 (not matching Women's 6.5. I realize that removing the ? from the end of the pattern, it will Match, 6.5, but when I remove the ([\.0-9]{2})? it will still match Women's 6.5 (as it's matching the first part and disregarding the .5)
Not sure how to approach this one using Regx.
Thanks!
Greg
I'm trying to do some HTML parsing using Regx, but I'm having some issues with my expression. I'm trying to match something like this:
[HTML]<option value="1">Women 's 6
<option value="2">Women 's 6.5[/HTML]
My expression looks like this:
[PHP]$msg_patt = "/<option value=\"(.*?)\" >([A-Za-z]+'[A-Za-z]{1} [0-9]+([\.0-9]{2})?)\n/";[/PHP]
Using preg_match_all the above expression matches both of the options (women's 6 and women's 6.5).
How can I change my expression so that it would match only Women's 6 (not matching Women's 6.5. I realize that removing the ? from the end of the pattern, it will Match, 6.5, but when I remove the ([\.0-9]{2})? it will still match Women's 6.5 (as it's matching the first part and disregarding the .5)
Not sure how to approach this one using Regx.
Thanks!
Greg
Comment