Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

regex pattern to mathc IP address

// 127.0.0.1 is valid
// 192.168.123.231 is valid

// 256.0.0.1 is not valid
// 127.0.1 is not valid
// -1.0.0.1 is not valid
// 127.0.0.1. is not valid
String ipAddressRegex = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(.(?!$)|$)){4}$";
Source by mkyong.com #
 
PREVIOUS NEXT
Tagged: #regex #pattern #mathc #IP #address
ADD COMMENT
Topic
Name
3+7 =