use strict; use warnings; use YAPE::Regex::Explain; my $regex1 = qr{\QHello# World\E}x; my $parser1 = YAPE::Regex::Explain->new($regex1)->explain; print "$parser1\n"; print "*" x 20; print "\n"; my $regex2 = qr{Hello\#\ World}x; my $parser2 = YAPE::Regex::Explain->new($regex2)->explain; print "$parser2\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 ---------------------------------------------------------------------- ******************** The regular expression: (?x-ims:Hello\#\ World) 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' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------