in reply to Replacing new line characters from HTML TEXTAREA submissions
Maybe it is a bit too greedy for some people but for me, ack, one more newline and/or carriage returns is enough for a P tag.$info=~s/[\n\r]{1,2}/<p>/gms; or $info=~s/[\n\r]+/<p>/gms;
I just noticed that your regular expression was just /g, keep in minde it WILL stop matching on the first line. You gotta let 'er match the entire string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Useless use of /s and /m in a harmless context
by dvergin (Monsignor) on Mar 15, 2001 at 01:39 UTC |