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.
The reason your code isn't working is that the / characters aren't escaped as \/ or is that Perlmonks not faithfully reproducing your input?$text =~ s/<link=("[^"]*")>(.*?)<\/link>/<a href=$1>$2/gi;
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 | |
by pbeckingham (Parson) on Jul 23, 2004 at 18:40 UTC |