Re: preg_match_all



On Sat, 31 May 2008 16:49:30 +0200, Anthony Smith <mrsmithq@xxxxxxxxxxx> wrote:

I am trying to take a web page and get all of the links. It almost
works, but I am missing a few links.
Here is what I am using.
preg_match_all('/href=[\"\']?([^\"\'>]*)[\"\']?[^>]*>(.*?)<\/a>/i',
$s,$matches,PREG_SET_ORDER);


It will not pick up links like this:

<a class="highlight" href="browse.php?region=West
+Tennessee&amp;zips=38115&amp;mgrp=13&amp;p=2">
<b>Next &gt;</b>
</a>


How do I get it to pickup hrefs like the one above?

Add the /s modifier
--
Rik Wasmus
....spamrun finished
.