The first thing that jumps out at me is that the '.*' pattern is
going to be a greedy match. This means it will match everything,
swallowing the '" BORDER=0> part of the string too. You can make the
* non-greedy by putting a '?' after it.
$imageURL =~ !<IMG SRC="picserve.cgi?picserve=/(.*?)" BORDER=0>!;
but you might be better off with a character class
$imageURL =~ !<IMG SRC="picserve.cgi?picserve=/[\w.-_]*" BORDER=0>!;
This might work for you tho I haven't tried it. I seem to remember
an HTML::Parser library on CPAN that might make you life easier if
your parsing html docs.
PC
On Feb 8, 2006, at 6:34 PM, Mike Blezien wrote:
Hello,
I'm trying to extract an image name from the follow html tag
$imageURL = "<IMG SRC="picserve.cgi?picserve=/thebest_Small.png"
BORDER=0>"
now I need to extract the 'thebest_Small.png' filename from the img
tag, but havent't been able to figure out how to do this correctly.
i tried:
$imageURL =~ !<IMG SRC="picserve.cgi?picserve=/(.*)" BORDER=0>!;
$pic = $1;
but that produces errors. what I'm doing wrong here ??
TIA,
--
Mike(mickalo)Blezien
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>