in reply to How do I match a number range?

Don't. Use the regexp to get the number then do a nice simple numeric compare.
if ($n >= 5278 and $n <= 5391) { #stuff with $n }

The regexp is too evil to imagine and writing a general case regexp for when you need to change the numbers is even worse.

buuuuut... this works if you meant inclusive of 5278 and 5391... /\b5(2([89]\d|7[89])|3([0-8]\d|9[01]))\b/

Originally posted as a Categorized Answer.