Anyway, here's an untested attempt. Most likely, it breaks on your second example:
my (undef, $new, $hit) = $in =~ m{ <td><img \s+ src \s* = \s* (["']) foo[.]jpg \1 > (<a \s+ href \s* = (["']) [^"']* \4 > [^<]* </a>}ix;
Abigail
In reply to Re: Regexp riddles
by Abigail-II
in thread Regexp to extract HTML link data
by hatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |