|
před 2 roky | |
---|---|---|
.. | ||
lib | před 2 roky | |
node_modules | před 2 roky | |
CHANGELOG.md | před 2 roky | |
LICENSE | před 2 roky | |
README.md | před 2 roky | |
package.json | před 2 roky |
regular expression for matching CJK text
# using npm
npm install --save cjk-regex
# using yarn
yarn add cjk-regex
const cjk = require("cjk-regex");
const cjk_charset = cjk();
cjk_charset.toRegExp().test("a"); //=> false
cjk_charset.toRegExp().test("。"); //=> true
cjk_charset.toRegExp().test("中"); //=> true
const cjk_letter_charset = cjk.letters();
cjk_letter_charset.toRegExp().test("a"); //=> false
cjk_letter_charset.toRegExp().test("。"); //=> false
cjk_letter_charset.toRegExp().test("中"); //=> true
const cjk_punctuaion_charset = cjk.punctuations();
cjk_punctuaion_charset.toRegExp().test("a"); //=> false
cjk_punctuaion_charset.toRegExp().test("。"); //=> true
cjk_punctuaion_charset.toRegExp().test("中"); //=> false
Returns a Charset.
# lint
yarn run lint
# build
yarn run build
# test
yarn run test
MIT © Ika