aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils/Validator.java
blob: 9ca1e34f665409c46a9969bde1f50a67c17c0621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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("\\b^[^@/<>'\"\\s]+@[^@/<>'\"\\s]+$", Pattern.CASE_INSENSITIVE);
	
	public static boolean isValidJid(String jid) {
		Matcher matcher = VALID_JID.matcher(jid);
		return matcher.find();
	}
}