use YAPE::Regex::Explain; $regex1 = qr{\QHello# World\E}x; $parser1 = YAPE::Regex::Explain->new($regex1)->explain; print "$parser1\n" #### The regular expression: (?x-ims:Hello\#\ World\\E) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?x-ims: group, but do not capture (disregarding whitespace and comments) (case-sensitive) (with ^ and $ matching normally) (with . not matching \n): ---------------------------------------------------------------------- Hello 'Hello' ---------------------------------------------------------------------- \# '#' ---------------------------------------------------------------------- \ ' ' ---------------------------------------------------------------------- World 'World' ---------------------------------------------------------------------- \\ '\' ---------------------------------------------------------------------- E 'E' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------