Forum Discussion
mister_paul_717
May 14, 2012Nimbostratus
Here is an example of a regex that should work to force the numbers to be between 0 and 255. This is just one octet - you would have to do this 4 times, with \. between each.
(25[0-5])|(2[0-4][0-9])|([0-1][0-9][0-9])|([0-9]{1,2})
So the full regex would be:
(25[0-5])|(2[0-4][0-9])|([0-1][0-9][0-9])|([0-9]{1,2})\.(25[0-5])|(2[0-4][0-9])|([0-1][0-9][0-9])|([0-9]{1,2})\.(25[0-5])|(2[0-4][0-9])|([0-1][0-9][0-9])|([0-9]{1,2})\.(25[0-5])|(2[0-4][0-9])|([0-1][0-9][0-9])|([0-9]{1,2})
Yuck.