Implemento pattern con expresiones regulares

parent c2be41b4
......@@ -37,9 +37,11 @@ public class Usuario {
private String DNI;
@Size(min=9, max=9)
@Pattern(regexp=ExprReg.TELEFONO)
private int telefono;
@Pattern(regexp= ExprReg.EMAIL)
private String email;
@NotNull
......
......@@ -4,7 +4,7 @@ public class ExprReg {
public ExprReg(){}
public static final String DNI = "\\\\d{8}[A-HJ-NP-TV-Z]";
public static final int TELEFONO = Integer.parseInt("^[67-9]\\d{8}$");
public static final String TELEFONO = ("^[67-9]\\d{8}$");
public static final String EMAIL = "^[A-Za-z0-9+_.-]+@(.+)$";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment