Verify and validate an IP address with regular expressions

The following regular expression checks the validity of an IPv4.

private static final Pattern PATTERN = Pattern.compile(
"^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.) {3} ([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");

public static boolean validate(final String ip) {
return PATTERN.matcher(ip).matches();
}

Description:

^ #Début
( # Start of group #1
[01]?\\d\\d? # Can be one or two digits. If the number is greater than 100, it should start with a 0 or 1
# e.g. ([0-9], [0-9][0-9],[0-1][0-9][0-9])
| # ... or
2[0-4]\\d # starts with 2, followed by 0-4 and ends with any digit
| # ... or
25[0-5] # starts with 2, followed by 5 and ends with 0-5< /> ) # end of group #2 \. # followed by a period "."
.... # repeat 3 times (3x)
#fin