use strict; use warnings; my $string = "Hello world!"; $string =~ m/(H\w+)\s(\w+)/; # This match succeeds. print $2, "\n"; $string =~ /(\d)(\d)/; # This match fails. print $2, "\n";