in reply to automagic-HTML regex
s{(?mx: # Explicitly set /mx for this scope. This puts the modifiers right + up where they are being used instead of at the end of the regex. ^\[$ ((?s:.*?)) # Non-greedy match of multiple lines ^\]$ )}{ my $tmp = $1; $tmp =~ s{^([^\n]+)$}{<li>$1</li>}mg; # Added /m and fixed closing + bracket. Preferred [^\n] to . for explictness. "<ul>$tmp</ul>" }eg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: automagic-HTML regex
by Cody Pendant (Prior) on Jun 16, 2003 at 23:16 UTC |