Either with PHP or a RegExp (or both), how do I match a range of IP addresses?
10.210.12.12
10.253.12.12
10.210.12.254
10.210.1
Regex really doesn't sound like the right tool to deal with subnet masks (at least not in decimal). It can be done, but it will be ugly.
I strongly suggest parsing the string into 4 integers, combining to a 32-bit int, and then using standard bitwise operations (basically a bitwise-AND, and then a comparison).