/app/src/main/java/Utility/Validator.java
Java | 24 lines | 17 code | 4 blank | 3 comment | 0 complexity | 0e9735963b13afe003595e3277740298 MD5 | raw file
- package Utility;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- /**
- * Created by haider_kazal on 12/19/15.
- */
- public class Validator {
- public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
- Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
- public static final Pattern VALID_MOBILE_NUMBER_REGEX =
- Pattern.compile("", Pattern.CASE_INSENSITIVE);
- public static boolean isValidEmail(String email) {
- Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(email);
- return matcher.find();
- }
- public static boolean isValidMobileNumber(String mobileNumber) {
- Matcher matcher = VALID_MOBILE_NUMBER_REGEX.matcher(mobileNumber);
- return matcher.find();
- }
- }