static String matchStringOrThrow(Pattern p,ToDateParser params,Enum<?> aEnum){
  String s=params.getInputStr();
  Matcher matcher=p.matcher(s);
  if (!matcher.find()) {
    throwException(params,format("Issue happened when parsing token '%s'",aEnum.name()));
  }
  return matcher.group(1);
}

static String matchStringOrThrow ( Pattern p , ToDateParser params , Enum < ? > aEnum ) { String s = params . getInputStr ( ) ; Matcher matcher = p . matcher ( s ) ; if ( ! matcher . find ( ) ) { throwException ( params , format ( "Issue happened when parsing token '%s'" , aEnum . name ( ) ) ) ; } return matcher . group ( 1 ) ; }
match the pattern , or if not possible throw an exception .
