Conversations/src/eu/siacs/conversations/utils/Validator.java
Daniel Gultsch acf80bddd0 rebranding
2014-02-28 18:46:01 +01:00

15 lines
389 B
Java

package eu.siacs.conversations.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Validator {
public static final Pattern VALID_JID =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
public static boolean isValidJid(String jid) {
Matcher matcher = VALID_JID.matcher(jid);
return matcher.find();
}
}