|
Posted by Steve on 10/12/07 15:27
<kosanovic@gmail.com> wrote in message
news:1192201960.982311.106940@i13g2000prf.googlegroups.com...
> Hello,
> I'm bad at regular expressions. Would somebody help me:
> I need to extract all URL to .jpg and .png pictures from a string
> containing an HTML file (DOM wouldn't work well in what I need).
>
> I've tried:
>
> preg_match_all("/.jpg$|.png$/", $htmlfile, $Matches);
> foreach ($Matches as $match)
> {
> echo $match."<br>";
> }
\.(jpe?g|png)\b+$?
that should cure what ailes you. this is free handed, but after eyeballing
regex for years, i'm pretty sure it will work 'outta the box'.
cheers
Navigation:
[Reply to this message]
|