in reply to How do I match a number range?

This isn't really a regular expression question. You would be better off breaking the task into parts, first to ensure that you have the sort of number you want (for instance, this tests for an integer, and captures it into $1):

$foo =~ /^(\d+)$/;

This can then be combined into an if clause:

if ( $foo =~ /^(\d+)$/ && $1 >= 5278 && $1 <= 5391) { .. }

although this suffers as you cannot test for 'numberyness' and 'being in the right range' at the same time, to do that, you will need to do it in seperate stages.

Originally posted as a Categorized Answer.