Chinese character regular. Friends familiar with character sets. Solution
Source: Internet
Author: User
Chinese character regular .. Friends who are familiar with character sets .. What are the situations for matching Chinese character regular expressions? In each case, how do I write regular expressions? For example, how do I match the ASCII and UNICODE encoding gb2312 & nbsp; gbk & nbsp; big5? Depends on what font library is used for the service? For the matching of UICODE encoding, the regular fan Chinese character regular is provided on the Internet .. Friends who are familiar with character sets ..
What are the situations for matching Chinese character regular expressions?
In each case, how do I write regular expressions?
For example, ASCII and UNICODE encoding
How does gb2312 gbk big5 match? Depends on what font library is used for the service?
For the matching of UICODE encoding, the regular range provided on the Internet is:
[\ U4e00-\ u9fa5]
However, I checked the UNICODE encoding table and found that:
There are Chinese characters from 3220 ..
In addition, is \ x80-\ xff a matching ASCII code?
Click here ..
For more information, see ..
I am very grateful .......
------ Solution --------------------
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.
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.