http://www.perlmonks.org?node_id=77097


in reply to Re: Re: Re: How many bugs can *you* find
in thread How many bugs can *you* find

To nitpick further doing s///'ing \n and \r separatly is faster using a char class.

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: How many bugs can *you* find
by satchboost (Scribe) on May 01, 2001 at 23:58 UTC
    That may be true in general, but the idea is to take the CRLF sequence in Unix (\n) and the CRLF sequence in Windows (\n\r) and replace either of them with <p>. To do that, one regex is simpler than two.
      FYI when I am on Unix looking at files from DOS, the end of line sequence is \r\n, not \n\r.
      a character case won't solve that :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.
        You're right. That's why that was a bug. :) A better solution would have been s/\n\r?/<p>/g;, not that character class.