use YAPE::Regex::Explain; print YAPE::Regex::Explain->new( qr/ \n ( .* procdump .*) \n /mx )->explain; __END__ The regular expression: (?mx-is: \n ( .* procdump .*) \n ) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?mx-is: group, but do not capture (with ^ and $ matching start and end of line) (disregarding whitespace and comments) (case-sensitive) (with . not matching \n): ---------------------------------------------------------------------- \n '\n' (newline) ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- procdump 'procdump' ---------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- \n '\n' (newline) ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------