java中日语的utf-8编码范围(正则表达式匹配)

时间:2023-01-10 11:19:11
package org.jimmy.autotranslate20181022.test;

import java.util.regex.Pattern;

public class Regular20181106 {

    public static void main(String[] args) {
        String reg = "[\u30a0-\u30ff\u3040-\u309f\u30fc-\u30ff\u4e00-\u9faf\u3400-\u4dbf]+";
        Pattern pattern = Pattern.compile(reg);
        System.out.println(pattern.matcher("疾风かぜを駆かけ抜ぬけて").matches());
    }

}

utf-8编码范围转自ta的博客,详情请看ta这篇,谢谢:

http://xuehaipeng.iteye.com/blog/613825

运行结果:

java中日语的utf-8编码范围(正则表达式匹配)