Javascript Regular expression to match non-ASCII characters
ملاحظة_مؤرشفة
المعرفة::
المراجع:: https://stackoverflow.com/a/48902765
Unicode Property Escapes are among the features of ES2018.
Basic Usage¶
With Unicode Property Escapes, you can match a letter from any language with the following simple regular expression:
Or with the shorthand, even terser:
Matching Words¶
Regarding the question’s concrete use case (matching words), note that you can use Unicode Property Escapes in character classes, making it easy to match letters together with other word-characters like hyphens:
Stitching it all together, you could match words of all[1] languages with this beautifully short RegEx:
Last update :
August 14, 2023
Created : August 23, 2022
Created : August 23, 2022