Posted by crescent_au on 07/07/06 01:18
> It most likely has to do with the greediness of *. Regular expressions
> will match the *longest* possible string. To prevent this, use '?'.
> given the string: "<a>text</a>more</a>"
> <a>.*</a> matches "<a>text</a>more</a>"
> <a>.*?</a> matches "<a>text</a>"
Well what i basically want is:
<a class="something" href=http://something.com/abc.php">Shopping
Cart</a>
I want the RE to parse the HTML tag and see if it starts with '<a
class="something" href=', then IGNORE whatever is between 'href=' and
'>', and ending with '</a>'. I couldn't figure out how to "ignore" the
text in between.
Navigation:
[Reply to this message]
|