Specifying Patterns (Cont.)
$test = "You have new mail -- 12-3-01";
if ($test =~ /^You\s.+\d+-\d+-\d+/ ) {
print "The mail has arrived."; }
if ($test =~
m(
^
You
\s
.+
\d+
-
\d+
-
\d+
)
{ print "The mail has arrived."; }
Previous slide
Next slide
Back to first slide
View graphic version