in reply to Range Issue with RegEx
First of all, [30-33] does NOT match 30, 31, 32; it matches any of the single characters 3, 0 - 3, 3, which is the same as [0-3]. (The expression [...] is a character class, meaning that it matches only a single character).
Secondly, when you do /50[0-2]|5[30-33]/, you are trying to match 4 characters in a row: 5, 0, 0-2 or 5, 0-3.
I think what you want instead is:
if ($tag =~ /^(50[0-2])|(53[0-2])$/)
or more simply:
if ($tag =~ /^(50|53)[0-2]$/)
or even:
if ($tag =~ /^5(0|3)[0-2]$/) # Note the parentheses ( ) are optiona +l
|
|---|