aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/utils/Validator.java
blob: a29ffa0ae156fcade4c570ad48593958a4794a9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package de.gultsch.chat.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();
	}
}