import java.util.regex.Pattern;

public class JI9029322 {

	public static void main(String[] args) {
		String text = "\ud800\udc00"; // U+010000 

		// Patterns which wrongly match the latter half of the surrogate pair. 
		System.out.println(Pattern.compile("\\udc00").matcher(text).find()); 
		System.out.println(Pattern.compile("\\x{dc00}").matcher(text).find()); 
		System.out.println(Pattern.compile("[\\udc00-\\udfff]").matcher(text).find()); 
		System.out.println(Pattern.compile("[\\x{dc00}-\\x{dfff}]").matcher(text).find()); 
		System.out.println(Pattern.compile("[\\p{blk=Low Surrogates}]").matcher(text).find()); 

		// These patterns do not cause the problem. 
		System.out.println(Pattern.compile("\udc00").matcher(text).find()); 
		System.out.println(Pattern.compile("[\udc00-\udfff]").matcher(text).find()); 

	}

}
