As above, I'd recommend using number equality instead of regular expressions if that's what you really mean. The range operator and grep are handy for this, like in this (untested) snippet:
(Remember that the $_ in the grep expression is not the same as the $_ in the while loop. More info at grep.)while (<DATA>){ chomp; $tag = $_; if (grep {$tag == $_} 500..503,531,532) { print "$tag\n"; } }
In reply to Re: Range Issue with RegEx
by VSarkiss
in thread Range Issue with RegEx
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |