m{ # Word boundary. \b # Start capture of pattern matched; ( # literal string "MODULE", MODULE # one or more space characters, \s+ # one or more A-Z letters (represented as character class), [A-Z]+ # one or more 0-9 digits, [0-9]+ # stop capture. ) # Zero or more space characters. \s* # 1-element character class, or "escaped" "(" (not start of capture); [(] # any & everything until ... .+? # ... literal ")". [)] }x # /x flag allows to expand the regex as you see above & mentioned elsewhere.