mdi has asked for the wisdom of the Perl Monks concerning the following question:
Here's the regex I'm using:
s/(?<=\|)\.?\s*(?=\||$)/\\N/g;The problem I'm seeing is that if a line in a file ends with '| ', the space is correctly replaced with '\N', but the newline is also sucked up in the substitution causing the line below to now become part of the line above. I've checked that there is actually a newline in the file.
I'm sure it's probably something simple, but I can seem to figure out what's causing this behavior.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex substituion eating newlines
by Roy Johnson (Monsignor) on May 10, 2005 at 11:41 UTC | |
by mdi (Acolyte) on May 10, 2005 at 12:08 UTC | |
|
Re: Regex substituion eating newlines
by tlm (Prior) on May 10, 2005 at 12:06 UTC | |
|
Re: Regex substituion eating newlines
by thcsoft (Monk) on May 10, 2005 at 11:37 UTC |