Update Validator.java

This commit is contained in:
the-username 2014-05-15 20:43:10 +02:00 committed by Daniel Gultsch
parent a32d95cdd3
commit e34fddd7e1

View file

@ -5,7 +5,7 @@ import java.util.regex.Pattern;
public class Validator { public class Validator {
public static final Pattern VALID_JID = public static final Pattern VALID_JID =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE); Pattern.compile("\\b^[A-Z0-9._%+-]+@([A-Z0-9.-]+\\.)?\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}\\b$|^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
public static boolean isValidJid(String jid) { public static boolean isValidJid(String jid) {
Matcher matcher = VALID_JID.matcher(jid); Matcher matcher = VALID_JID.matcher(jid);