in reply to Re: (Regex Madness) And you thought whitespace was easy.
in thread (Regex Madness) And you thought whitespace was easy.

It requires you to scan your string for a substring not yet used. That requires you scan the string at least once, or use a string that is one character LONGER than your string.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: Re: (Regex Madness) And you thought whitespace was easy.

Replies are listed 'Best First'.
Re: Re: Re: (Regex Madness) And you thought whitespace was easy.
by runrig (Abbot) on Aug 15, 2001 at 11:32 UTC
    How about this then:
    join "\n\n", map { s/\s+/ /; $_ } split(/\n{2}/, $_, -1);