I have a growing list of regular expressions that I am using to parse through log files searching for \"interesting\" error and debug statements. I\'m currently breaking th
You can combine your regexes with the alternation operator |, as in: /pattern1|pattern2|pattern3/
Obviously, it won't be very maintainable if you put all of them in a single line, but you've got options to mitigate that.
/x regex modifier to space them nicely, one per line. A word of caution if you choose this direction: you'll have to explicitely specify the space characters you expect, otherwise they'd be be ignored because of the /x.You can generate your regular expression at run-time, by combining individual sources. Something like this (untested):
my $regex = join '|', @sources;
while (<>) {
next unless /$regex/o;
say;
}