Last active
February 6, 2017 02:18
-
-
Save lackneets/e9d0d5209831b0ec528a to your computer and use it in GitHub Desktop.
Match Chinese and Japanese Characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var regexCJ = /[\u4e00-\u9fa5]+|[\u0800-\u4e00]+/ | |
!!'안녕하세요'.match(regexCJ) // false | |
!!'Hi There'.match(regexCJ) // false | |
!!'おはよう'.match(regexCJ) // true | |
!!'ㄤㄤ'.match(regexCJ) // true | |
!!'你好'.match(regexCJ) // true | |
!!'中国共产党万岁'.match(regexCJ) // true | |
// FIXME: complete the CJK! tell me the Koreanese pattern if you know |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment