Java matches Regular Expressions in Chinese and java matches regular expressions.
[\u4E00-\u9FA5]*
Public static void regxChinese () {// String source = "<span title = '5 star hotels 'class = 'dx dx5'> "; // convert the string to be matched to lower case // source = source. toLowerCase (); // The regular expression String reg_charset = "<span [^>] *? Title = \ '([0-9] * [\ s | \ S] * [\ u4E00-\ u9FA5] *) \ '[\ s | \ S] * class = \' [a-z] * [\ s | \ S] * [a-z] * [0 -9] * \ '"; pattern p = Pattern. compile (reg_charset); Matcher m = p. matcher (source); while (m. find () {System. out. println (m. group (1) ;}} public static void regxChinese () {// String source = "<span title = '5-star hotels 'class = 'dx dx5'> "; // convert the string to be matched to lower case // source = source. toLowerCase (); // Regular Expression of the matched String r Eg_charset = "<span [^>] *? Title = \ '([0-9] * [\ s | \ S] * [\ u4E00-\ u9FA5] *) \ '[\ s | \ S] * class = \' [a-z] * [\ s | \ S] * [a-z] * [0 -9] * \ '"; pattern p = Pattern. compile (reg_charset); Matcher m = p. matcher (source); while (m. find () {System. out. println (m. group (1 ));}}
Java regular expressions match real names (27 Chinese or 310 English)
Public static void main (String [] args ){
String regx = "([\ u4E00-\ u9FA5] {}) | ([a-zA-Z }))";
System. out. println (Pattern. matches (regx, "I am, I am, I am "));
System. out. println (Pattern. matches (regx, "aBcDefghij "));
}
In java, how does one use regular expressions to match strings with fixed byte lengths that can contain Chinese characters?
I can only help you to write a string that determines whether it is composed of numbers and English characters.
^ (? = [A-Za-z0-9] *) (? = [U4e00-u9fa5]) [\ u4e00-\ u9fa5A-Za-z0-9] * $
Is there 10 (two dubyte counts)? Can you use java to write code?