-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

oops...
sorry
strange bug happened on my newsreader...
'joel boonstra' regex seems to be the better one hehe
all others forgot that if u start with ', u must end with ' hehe (same thing with " :p)



i dont know why i used square brakets for \s... kinda stupid hehe


André cerqueira wrote:
did you post the same message 7 times?

try:
<?
$subject = '<img src="THIS12BIT.ext">';
$pattern = '/<img[\s]+?src=[\'"](.+?)[\'"].*?>/i';

$matchFound = preg_match_all ($pattern, $subject, $matches, PREG_SET_ORDER);

print_r($matches);
//$matches[$i][1] is what really matters
?>


that pattern may not be the best regex to use, but i think it works for most cases



Pete M wrote:


Im trying to scan a file and lift the image name from the <img tag

ie
<img src="THISBIT.ext">
where there could be ' or "

I messed around but am 2 embarassed to post code cos it dont work ;-(

thanks in advance

pete

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFALbEmaxdA/5C8vH8RArxLAJwNJXHouP4meJXRo4c+8xye12H/4QCgk5gE
YHIReAkKxtFwyD7dLWZIPWc=
=2eBJ
-----END PGP SIGNATURE-----

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to