JS regular expression script for extracting all Chinese characters in the string


It is found on the Internet that someone has realized this function with VBScript regular expression, but the code is very factory. It is even changed to JS. A very short piece of code:

[Ctrl + a full selection note: you need to refresh the page to import external JS]

The key here isThe coding range after Chinese escape is \ u4e00 – \ u9fa5, it’s easy to solve this problem if you know it.