Mega Code Archive

 
Categories / Perl / Regular Expression
 

If ($text =~ (d+)) {print Heres the number of apples

$text = "I have 4 apples."; if ($text =~ /(\d+)/) {print "Here's the number of apples: $1.\n";}