Analysis on finding Chinese Characters in text using regular expressions in Notepad ++

Source: Internet
Author: User

Notepad ++ can search for regular expressions,

Search for Chinese characters by chance

However, it is found that

[\ U4e00-\ u9fa5]
[1-Example]
It is not easy to use. Sometimes, some Chinese characters are not recognized for being "long. However, after copying these texts, you can find them.
 
The study found that, because TXT files from notepad or other places are generally saved in ANSI format, you should find them by single character, notepad ++ is Unicode by default. Therefore,
[\ U4e00-\ u9fa5] is encoded in UNICODE, so it works well.
Similarly, the above TXT file is saved as UTF-8 and opened with notepad again. The above regular expression can work well.
In addition, the basic regular expression rules for transferring points are used later.
Expression description \ t tab. \ n new line .. match any character. | match the characters on the left and right of the expression. for example, "AB | BC" matches "AB" or "BC ". [] match any single character in the list. for example, "[AB]" matches "A" or "B ". "[0-9]" matches any number. [^] matches any single character out of the list. for example, "[^ AB]" matches characters other than "A" and "B. "[^ 0-9]" matches any non-numeric characters. * The character on the left is matched any time (0 or multiple times ). for example, "Be *" matches "B", "be", or "Bee ". + The character on the left is matched at least once (once or multiple times ). for example, "Be +" matches "be" or "Bee" but does not match "B ".? The character on the left is matched 0 times or 1 time. For example, "be? "Match" B "or" be "but not" Bee ". ^ The expression on the right is matched at the beginning of a row. for example, "^ A" only matches rows starting with ". $ the expression on the left is matched at the end of a row. for example, "e $" only matches rows ending with "E. () affects the order of expression matching and is used as the grouping tag of the expression. \ escape character. if you want to use "\", you should use "\\".

Related Article

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.