qr//, , . , *, , * .
, . /M , (^, $)./S , . . /X # .
, , :
my $sc = qr{(>|\s)};
my $re = qr{# using defaults found in \.config
\*
\*
Options:
$sc 1\. opt1
$sc 2\. opt2
choice\[1-2\?]: };
Perl Best Practices, , , . , , , , , .:) , /x. , - , #. , , :
my $sc = qr{(>|\s)};
my $eol = qr{[\r\n]+};
my $re = qr{\# \s+ using \s+ defaults \s+ found \s+ in \s+ \.config $eol
\* $eol
\* $eol
Options: $eol
$sc \s+ 1\. \s+ opt1 $eol
$sc \s+ 2\. \s+ opt2 $eol
choice\[1-2\?]: \s+
}x;
if ( $output =~ $re ) {
print "OK!\n";
}
else {
print "D'oh!\n";
}