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



HTTP404
Deleted

Mar 11, 2001, 2:50 AM


Views: 199
Pattern to Match 2 newline chars

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




Jean
User


Mar 11, 2001, 3:08 AM


Views: 197
Re: Pattern to Match 2 newline chars

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.
mage@lycosmail.com