while($text =~ m|\*\*(\w+)\b|g) { print "Found: " , $1 , "\n"; }