private static String[] match(String value){
  if (value == null) {
    return null;
  }
  Matcher matcher=IPV4_PATTERN.matcher(value);
  if (matcher.matches()) {
    int count=matcher.groupCount();
    String[] groups=new String[count];
    for (int j=0; j < count; j++) {
      groups[j]=matcher.group(j + 1);
    }
    return groups;
  }
  return null;
}

private static String [ ] match ( String value ) { if ( value == null ) { return null ; } Matcher matcher = IPV4_PATTERN . matcher ( value ) ; if ( matcher . matches ( ) ) { int count = matcher . groupCount ( ) ; String [ ] groups = new String [ count ] ; for ( int j = 0 ; j < count ; j ++ ) { groups [ j ] = matcher . group ( j + 1 ) ; } return groups ; } return null ; }
validate a value against the set of regular expressions returning the array of matched groups . from the apache regexvalidator class .
