Specifying Patterns (Cont.)
$test = "You have new mail -- 5-24-99";
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