in reply to automagic-HTML regex
Your problem is in the very first line of that regex. The dollar in ^\[$ does not match a newline. It matches right before the newline. So, that newline goes into your $1 captured by (.*) with the /s modifier. In your second substitution (the one in the eval'd part of the first one), that caret (^) will match the begining of the first line in $1 which, in your case, contains a single newline.
You can fix it by telling your regex to match an opening brace and then match as much whitespace as possible. Try changing ^\[$ to ^\[\s*.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: automagic-HTML regex
by Enlil (Parson) on Jun 16, 2003 at 22:54 UTC |