Blob


1 #!/usr/bin/perl
2 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
3 ##
4 ## Permission is granted to use, copy, modify, and/or distribute
5 ## this work for any purpose with or without fee. This work is
6 ## offered as-is, with absolutely no warranty whatsoever. The
7 ## author is not responsible for any damages that result from
8 ## using this work.
9 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
10 ##
11 ## Permission is granted to use, copy, modify, and/or distribute
12 ## this work for any purpose with or without fee. This work is
13 ## offered as-is, with absolutely no warranty whatsoever. The
14 ## author is not responsible for any damages that result from
15 ## using this work.
16 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
17 ##
18 ## Permission is granted to use, copy, modify, and/or distribute
19 ## this work for any purpose with or without fee. This work is
20 ## offered as-is, with absolutely no warranty whatsoever. The
21 ## author is not responsible for any damages that result from
22 ## using this work.
23 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
24 ##
25 ## Permission is granted to use, copy, modify, and/or distribute
26 ## this work for any purpose with or without fee. This work is
27 ## offered as-is, with absolutely no warranty whatsoever. The
28 ## author is not responsible for any damages that result from
29 ## using this work.
30 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
31 ##
32 ## Permission is granted to use, copy, modify, and/or distribute
33 ## this work for any purpose with or without fee. This work is
34 ## offered as-is, with absolutely no warranty whatsoever. The
35 ## author is not responsible for any damages that result from
36 ## using this work.
37 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
38 ##
39 ## Permission is granted to use, copy, modify, and/or distribute
40 ## this work for any purpose with or without fee. This work is
41 ## offered as-is, with absolutely no warranty whatsoever. The
42 ## author is not responsible for any damages that result from
43 ## using this work.
44 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
45 ##
46 ## Permission is granted to use, copy, modify, and/or distribute
47 ## this work for any purpose with or without fee. This work is
48 ## offered as-is, with absolutely no warranty whatsoever. The
49 ## author is not responsible for any damages that result from
50 ## using this work.
51 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
52 ##
53 ## Permission is granted to use, copy, modify, and/or distribute
54 ## this work for any purpose with or without fee. This work is
55 ## offered as-is, with absolutely no warranty whatsoever. The
56 ## author is not responsible for any damages that result from
57 ## using this work.
58 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
59 ##
60 ## Permission is granted to use, copy, modify, and/or distribute
61 ## this work for any purpose with or without fee. This work is
62 ## offered as-is, with absolutely no warranty whatsoever. The
63 ## author is not responsible for any damages that result from
64 ## using this work.
65 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
66 ##
67 ## Permission is granted to use, copy, modify, and/or distribute
68 ## this work for any purpose with or without fee. This work is
69 ## offered as-is, with absolutely no warranty whatsoever. The
70 ## author is not responsible for any damages that result from
71 ## using this work.
72 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
73 ##
74 ## Permission is granted to use, copy, modify, and/or distribute
75 ## this work for any purpose with or without fee. This work is
76 ## offered as-is, with absolutely no warranty whatsoever. The
77 ## author is not responsible for any damages that result from
78 ## using this work.
80 # Make a pattern that will match three consecutive copies of whatever is
81 # currently contained in $what. That is, if $what is fred, your pattern
82 # should match fredfredfred. If $what is fred|barney, your pattern should
83 # match fredfredbarney or barneyfredfred or barneybarneybarney or many other
84 # variations. (Hint: you should set $what at the top of the pattern test
85 # program with a statement like my $what = 'fred|barney';.)
87 use warnings;
88 use strict;
89 use utf8;
91 my $what = "fred|barney";
93 while (<>) {
94 chomp;
95 if (/($what){3}/) {
96 print ("Match: $_\n");
97 } else {
98 print ("Not matched: $_\n");
99 }