diff --git a/1ano/2semestre/poo/src/utils/Validations.java b/1ano/2semestre/poo/src/utils/Validations.java index 902d67c..c333fc3 100644 --- a/1ano/2semestre/poo/src/utils/Validations.java +++ b/1ano/2semestre/poo/src/utils/Validations.java @@ -3,6 +3,10 @@ package utils; import java.util.regex.Pattern; public class Validations { + public static boolean validateEmail(String email) { + return Pattern.matches("^[a-zA-Z0-9._]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$", email); + } + public static boolean validateVehiclePlate(String plate) { return Pattern.matches("^[A-Z]{2}-\\d{2}-\\d{2}|\\d{2}-[A-Z]{2}-\\d{2}|\\d{2}-\\d{2}-[A-Z]{2}|[A-Z]{2}-\\d{2}-[A-Z]{2}|[A-Z]{2}-[A-Z]{2}-\\d{2}|\\d{2}-[A-Z]{2}-[A-Z]{2}$", plate); }