Hi All,
Greetings for the day J
I wanted to use a regular expression to validate the input date format as “yyyy-mm-dd” which is a path parameter.
I tried as follows, but it is giving the Invalid syntax for the expression '[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]' Exception.
@GET
@Path("/{estdDate: [0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]}")
public EstdDateResponse SendDateResponse(
@PathParam("estdDate") String estdDate)
throws DatatypeConfigurationException {
}
I don't want to pass format to validate in resource request.
Please let me know how to use regular expressions to validate the date format as defined.