in reply to How do I match a number range?

I think that whether you really want to do this entirely within a regular expression depends on your needs. For example, you could do this:
if (/(\d{4})/ and $1 >= 5278 and $1 <= 5391) { # do something }
But that may not meet your requirements. So, you can certainly construct a regex which only matches numbers in that range:
/5(?:2(?:7[89]|[89][0-9])|3(?:[0-8][0-9]|9[01]))/
All you need is alternation, and (?:) for precedence.

Originally posted as a Categorized Answer.