is Chinese English Number by Regex - Java Internationalization

Java examples for Internationalization:Chinese

Description

is Chinese English Number by Regex

Demo Code


//package com.java2s;

import java.util.regex.Pattern;

public class Main {
    private static Pattern PATTERN_CHINISE_ENGGLISH_NUM = Pattern
            .compile("[a-zA-Z0-9\\u4e00-\\u9fa5]+");

    public static boolean isChineseEnglishNum(String chiniseEnglichNum) {
        if (chiniseEnglichNum == null)
            return false;
        else// w  w  w  .j  a va  2s.c om
            return PATTERN_CHINISE_ENGGLISH_NUM.matcher(chiniseEnglichNum)
                    .matches();
    }
}

Related Tutorials