Double-byte full-byte character-related Regular Expressions

Source: Internet
Author: User

Full Japanese

[/U30a1-/u30f6/u3041-/u3093/uff00-/Uffff/u4e00-/u9fa5]

 

Match Chinese characters:

RegEx r = new RegEx (@ "[/u4e00-/u9fa5] + ");
Matchcollection M = R. Match (yourstring );

-------------------------
If you need to use a regular expression to match Unicode characters...
Here are several main non-English character ranges (found on Google ):

2e80 ~ 33ffh: Symbol area of China, Japan, and South Korea. Reception of Kangxi Dictionary heads, China-Japan-South Korea auxiliary departments heads, phonetic symbols, Japanese Kana, Korean Notes, Chinese-Japan-South Korea symbols, punctuation marks, circled or including Rune numbers, months, and Japanese Kana combination, unit, year, month, date, and time.

3400 ~ 4 dffh: Japan and South Korea recognized the expansion of ideographic text area A, a total of 6,582 Chinese and Korean characters.

4e00 ~ 9 fffh: Japan and South Korea recognized the ideographic text area, a total of 20,902 Chinese and Korean characters.

A000 ~ A4ffh: Yi text area, which contains the texts and roots of Yi people in southern China.

Ac00 ~ D7ffh: A combination area of Korean and pinyin. It contains text in Korean Notes.

F900 ~ Faffh: compatible with ideographic text area, a total of 302 Chinese and Korean characters.

Fb00 ~ Fffdh: it is a text expression area that contains a combination of Latin characters, Hebrew characters, Arabic characters, Chinese-Japanese vertices, small characters, halfwidth characters, and fullwidth characters.

For example, to match all Chinese and Korean non-symbolic characters, the regular expression should be ^ [/u3400-/u9fff] + $
Theoretically, I copied a Korean file to MSN. co. Ko and found that it was not correct.
Copy A 'handler' to msn.co.jp ..

Then, expand the range to ^ [/u2e80-/u9fff] + $. This is all done. This should be the regular expression that matches the Chinese and Japanese characters, including traditional Chinese that we are still using blindly.

The regular expression for Chinese characters should be ^ [/u4e00-/u9fff] + $, which is very close to the ^ [/u4e00-/u9fa5] + $

Note that ^ [/u4e00-/u9fa5] + $ is a regular expression used to match simplified Chinese characters. In fact, traditional Chinese characters are also in the regular expression, I used the tester to test the 'central People's Republic of Korea 'and also passed the test. Of course, ^ [/u4e00-/u9fff] + $ is the same result.

 

========================================================== ========================================================== ===

 

Unicode encoding range of Chinese characters:/u4e00-/u9fa5,/uf900-/ufa2d

/Uf900-/ufa2d contains the following characters:

Even more slide strings lang
Lei is missing and he is tired. Ling is Ling, and Dan is angry. The North Region has no data, he said. chen Shen picked up if the traffic is slightly higher than Liang Liangliang traffic volume she was a nvwa travel service she was born
Ling liu Mao
Law Li Zhi Shi du Tuo sugar house cave violent behavior drop see Qu Yu Jing
Please refer to the following link for more information:

Although some of these characters are in the same shape as common characters, they are encoded differently and cannot be directly typed using the input method.

Use/u4e00-/u9fa5/uf900-/ufa2d for more information. However, this is not necessary. Generally, Chinese characters that can be typed by the input method are included in/u4e00-/u9fa5, therefore, you can only use/u4e00-/u9fa5.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.