I'm somewhat new to regular expressions and am writing validation for a quantity field where regular expressions need to be used.

How can I match all numbers less than or equal to 24?

I tried

```
var pat = /^[1-9]$|^[1-2]\d$|^3[0-6]$/;

```

But that only matches 1-24. Is there a simple way to match all possible numbers less than or equal to 24?