/ Published in: Regular Expression
Expand |
Embed | Plain Text
m/^([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])\. ([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])$/;
Comments
Subscribe to comments
You need to login to post a comment.

I've never seen an IP address with leading zeros; is that permitted? You could reduce your pattern length by combining the three trailing octets. http://snipplr.com/view/7522/ip-address/