Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Regex with newline

by typomaniac (Novice)
on Feb 07, 2012 at 02:50 UTC ( [id://952202]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex with newline
in thread Regex with newline

I know this was an old post but it answered a question for me however it also brought up another one....is there any way to limit the number of
tags to only two..that is, no matter how many times a user presses the enter key paragraphs are separated by two spaces(and no more than two). Thanks

Replies are listed 'Best First'.
Re^3: Regex with newline
by choroba (Cardinal) on Feb 07, 2012 at 11:54 UTC
    Yes. For example:
    $text =~ s%(?:\r\n){2,}%<br /><br />%g;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://952202]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-16 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found