Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: Re: Re: How many bugs can *you* find

by Beatnik (Parson)
on May 01, 2001 at 23:53 UTC ( #77097=note: print w/replies, xml ) Need Help??

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.

... 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 :)

      ... 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://77097]
Discipulus is Corion reading 'Gory details of parsing quoted constructs'?..
[perldigious]: That's awesome erix. One of my work friends, who coincidentally convinced me to learn Perl originally, has a Finnish pen-pal. I showed him this and he immediately wanted to send it along to her.
[perldigious]: Also coincidentally, I'm currently in the middle of a winter storm that has dropped 1 foot of snow and is expected to drop another. I might have to adapt this for customers/vendors who come visit and put it at the beggining of every presentation I give.
[Discipulus]: the photo was removed... Cyrano de Berjerac was not of the same idea..

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2016-12-06 16:24 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.