Your regex is completely invalid.
It matches zero or more number characters (3 times), then zero or more number characters again.
It will be true if you supply a blank string or any reasonable amount of random numbers.
The regular expression for accurately matching an IP address is far more complex.