I'm trying to create a regular expression to check to see if a valid phone number has been entered. There is something wrong with my regular expression. Here is the source code I'm using:
if (!Pattern.matches("(\\d{3}-){1,2}\\d{4}", s)) {
et.setError("Enter a valid Phone Number");
}
What am I doing wrong?