$s = 'aaaaaaaaa'; $s =~ /.+(a+)/; # greedy match print "$1\n"; # prints "a" (a single 'a') $s = 'aaaaaaaaa'; $s =~ /.+?(a+)/; # non-greedy match print "$1\n"; # prints "aaaaaaaa" (all the 'a's) #### $text =~ /$mm\/$dd\/$yy/; # works, but ugly $text =~ m|$mm/$dd/$yy|; # use different delimiter $text =~ m| $mm # month / $dd # day / $yy # year |x; # allow whitespace