A regular expression to match a Subnet Mask, which is a logical subdivision of an IP network.
/^(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/
IP Address (V4) Examples:
- 255.255.255.0
- 255.224.0.0
See Also:
- URL (With And Without Port Number) Regular Expressions
- IP Address (V6) With Port Regular Expression
- IP Address (V4) With Port Regular Expression