#!/usr/bin/perl -w use strict; my @array = map { qr{$_} } ('^abcd', 'cd[ef]g', 'cat$'); while (<>) { chomp; foreach my $re (@array) { print "Matched $re\n" if m{$re}; } }
In reply to Re: Hash/Array of Regular Expressions?
by bikeNomad
in thread Hash/Array of Regular Expressions?
by irom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |