s/([^\n])\n([^\n])/$1$2/g;That fails on fred\nX\nY\nbarney, since the X will be sucked up while fixing the preceding newline, and won't be available to match for the following newline.
Be very wary when matching right-side context. Passing it through to the "already seen" category means it won't be able to be left-side context for a later match.
-- Randal L. Schwartz, Perl hacker
In reply to Re: Re: Regex Question
by merlyn
in thread Regex Question
by madhatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |