is Chinese Char by Regex - Java Internationalization

Java examples for Internationalization:Chinese

Description

is Chinese Char by Regex

Demo Code


//package com.java2s;

import java.util.regex.Pattern;

public class Main {

    public final static boolean isChineseChar(String text) {
        return match(text, "^[\u0391-\uFFE5]+$");
    }/*from   ww w  .  ja  v  a  2  s . c  o m*/

    private final static boolean match(String text, String reg) {
        if (text == null || text.isEmpty())
            return false;
        return Pattern.compile(reg).matcher(text).matches();
    }
}

Related Tutorials