note
Sewi
If you know you have an IP-address (got it from a network socket, for example), it would be much more efficient to match it with a one-line regexp:<code>
/^(10\.\d+|172\.(1[6-9]|2\d|3[0-1])|192\.168)(\.\d+){2}$/;
</code>
If you got it from a non-network input (like a user form), don't trust in it, it may be 10.9999.1234.666.
791145
791149