in reply to capture psudo tags

Ignoring the ill-advised venture of parsing HTML with regular expressions, the following is a reduced version of your code that works better. You really only need to replace small <link> tags, not the entire text every time.

$text =~ s/<link=("[^"]*")>(.*?)<\/link>/<a href=$1>$2/gi;
The reason your code isn't working is that the / characters aren't escaped as \/ or is that Perlmonks not faithfully reproducing your input?

Update: Code improved - thank you Eimi Metamorphoumai.

Replies are listed 'Best First'.
Re^2: capture psudo tags
by Eimi Metamorphoumai (Deacon) on Jul 23, 2004 at 18:13 UTC
    But that doesn't accurately replace the closing </link> tags with </a>.

      Oops - thanks for pointing that out. I was careless.