Java examples for Internationalization:Chinese
is Chinese By Name in regex
//package com.java2s; import java.util.regex.Pattern; public class Main { public static void main(String[] argv) throws Exception { String str = "java2s.com"; System.out.println(isChineseByName(str)); }//from www. ja v a 2s. c om public static boolean isChineseByName(String str) { if (str == null) { return false; } String reg = "\\p{InCJK Unified Ideographs}&&\\P{Cn}"; Pattern pattern = Pattern.compile(reg); return pattern.matcher(str.trim()).find(); } }