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;