# a poor regex my $hot_meal = qr/hot.*meal/; say 'Found a hot meal!' if 'I have a hot meal' =~ $hot_meal; say 'Found a hot meal!' if 'I did some one-shot, piecemeal work!' =~ $hot_meal; #### my $minimal_greedy_match = qr/hot.*?meal/; #### say 'Found a hot meal' if 'ilikeahotmeal' =~ /$minimal_greedy_match/; #### my $minimal_greedy_at_least_one = qr/hot.+?meal/; unlike( 'ilikeahotmeal', $minimal_greedy_at_least_one ); like( 'i like a hot meal', $minimal_greedy_at_least_one ); #### my $seven_down = qr/\Al${letters_only}{2}m\Z/; #### my $seven_down = qr/\bl${letters_only}{2}m\b/;