anotherim/src/main/java/eu/siacs/conversations/utils/Validator.java
2014-10-22 15:47:11 -04:00

15 lines
375 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(
"^[^@/<>'\"\\s]+@[^@/<>'\"\\s]+$", Pattern.CASE_INSENSITIVE);
public static boolean isValidJid(String jid) {
Matcher matcher = VALID_JID.matcher(jid);
return matcher.find();
}
}