CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Pattern to Match 2 newline chars



Mar 11, 2001, 2:50 AM

Post #1 of 2 (118 views)
Pattern to Match 2 newline chars Can't Post

Pattern to Match 2 newline chars, i need to capture 2 presses of Enter key i tryed this

$line !~ /\s*/
$line !~ /\s{2}/
$line !~ /\n\n/
$line !~ /\s+/

but all these react only for 1 Enter key press


Mar 11, 2001, 3:08 AM

Post #2 of 2 (116 views)
Re: Pattern to Match 2 newline chars [In reply to] Can't Post

Usually, line will not include more than one \n.
In case user presses the Enter key twice, the first line will include only the first Enter. Second Enter must be captured either with additional line or some totally different way, like getc().

Jean Spector
QA Engineer @ Extent Technologies, Ltd.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives