Java - Write code to check if a string is Chinese by regex

Requirements

Write code to check if a string is Chinese by regex

Demo

//package com.book2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] argv) {
        String raw = "book2s.com";
        System.out.println(isChinese(raw));
    }/*  www  . j  a v  a 2  s .  c  o  m*/

    public static boolean isChinese(String raw) {
        Pattern p_str = Pattern.compile("[\\u4e00-\\u9fa5]+");
        Matcher m = p_str.matcher(raw);
        if (m.find() && m.group(0).equals(raw)) {
            return true;
        }
        return false;
    }
}

Related Exercise