1 ffd9a51f 2023-08-04 jrmu #!/usr/bin/perl
3 ffd9a51f 2023-08-04 jrmu # Using the pattern test program, make a pattern that matches if any word (in
4 ffd9a51f 2023-08-04 jrmu # the \w sense of word) ends with the letter 'a'. Does it match 'wilma' but
5 ffd9a51f 2023-08-04 jrmu # not 'barney'? Does it match 'Mrs. Wilma Flintstone'? What about
6 ffd9a51f 2023-08-04 jrmu # 'wilma&fred'? Try it on the sample text file from the Exercises in Chapter
7 ffd9a51f 2023-08-04 jrmu # 7 (and add these test strings if they weren't already in there).
9 ffd9a51f 2023-08-04 jrmu use warnings;
13 ffd9a51f 2023-08-04 jrmu while (<>) {
15 ffd9a51f 2023-08-04 jrmu if (/a\b/) {
16 ffd9a51f 2023-08-04 jrmu print "Matched: |$`<$&>$'|\n";
18 ffd9a51f 2023-08-04 jrmu print "No match: |$_|\n";