m|\*\*(\w+)\b|g #### while($text =~ m|\*\*(\w+)\b|g) { print "Found: " , $1 , "\n"; } #### m| \* #literal asterisk \* #ditto ( #start capture \w+ #one or more word characters aka [A-Za-z0-9_] ) #end capture \b #word boundary |gx #/x allows whitespace, /g makes it global (restart from last match position in this case)