It seems you already have an answer. However I have a little suggestion to improve your series of OR'd expressions. Instead of writing
($line =~ m/ex21/igm || $line =~ m/EX\-21/igm || $line =~ m/exhibit\-21/igm || $line =~ m/exhibit21/igm)
instead try this:
$line =~ /ex(?:hibit)?-?21/i
This matches an 'ex' optionally followed by 'hibit' optionally followed by '-' and then ending in '21'. You don't need the /g modifier if you are only looking for one match and you don't need the /m modifier if you aren't matching with ^ or $. This is shorter and to my eyes easier to read and therefore maintain. HTH.
In reply to Re: Series of REGEX with OR
by hippo
in thread Series of REGEX with OR
by wrkrbeee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |