I don't understand the question. Why not just capture what was matched, as in (note that the /g regex modifier is not used; it almost certainly does not do what you expect):
>perl -wMstrict -le "my $element = 'hi WEED ho'; if ($element =~ m{ (WEED|DIAL|PIES|KILLD) }xms) { my $match = $1; print qq{match: '$match'}; } " match: 'WEED'
In reply to Re: and or statement
by AnomalousMonk
in thread and or statement
by endsin1m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |