if($text =~ $pattern){ print $&; #prints entire match