Reply to Re: regular expression for parsing html using preg_match_all

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация