use HTML::Parser;
It handles maniacal markup you'll never think of in your homerolled regexen
Update: ++mkmcconn suggested I add HTML::TokeParser to the recommendation, and I agree (I knew I was forgetting a good one)
After Compline, Zaxo
| [reply] |
$body =~ s/<img src=(.*?)>/[image:<a href=$1>$1</a>]/gi;
Sounds like this might be what you're looking for.
Cheers,
kln | [reply] [d/l] |
You already identified one of the problems (and solutions
have been suggested for that), but let me point out that
your regex won't work either if there's whitespace between
"src" and "=".
BTW, HTML doesn't have alt tags. HTML has
alt attributes - which have been mandatory for
IMG tags for quite some time.
Abigail | [reply] |