r/bin/perl use v5.12; use warnings; ## 9/26/19 ## Program uses named captures instead of $1 chomp(my $text = ); while (<>) { # take one input line at a time chomp; if ( $text =~ m/((?\b\w*a\b))(?\s+++++))/) { print "Matched: |$`<$&>$'|\n"; # the special match vars print " 'word' contains '$+{word1} $+'\n"; } else { print "No match: |$_|\n"; } #### Nested quantifiers in regex; marked by <-- HERE in m/((?\b\w*a\b))(?\s+++ <-- HERE ++))/ at ./Chapter8_Exer5 line 12