Correct regex pattern for case-insensitive match

Updated the regex pattern in `StaffAppFormData.java` to ensure that the "yes" or "no" answers are case-insensitive. This improves the form validation to accept "Yes", "YES", "No", or "NO" without errors.
This commit is contained in:
Teriuihi 2024-08-07 21:34:25 +02:00
parent 514aaeb367
commit 9e0a33e782

View File

@ -45,7 +45,7 @@ public class StaffAppFormData extends Form {
@NotEmpty(message = "An answer is required")
@Length(min = 2, max = 3, message = "Please answer yes or no")
@Pattern(regexp = "(yes|no)$", message = "Yes or no")
@Pattern(regexp = "(?i)^(yes|no)$", message = "Yes or no")
public final String pc_requirements;
@Min(value = 0, message = "Please enter a valid age")