Denis 346b78aee1 first commit пре 2 година
..
lib 346b78aee1 first commit пре 2 година
node_modules 346b78aee1 first commit пре 2 година
CHANGELOG.md 346b78aee1 first commit пре 2 година
LICENSE 346b78aee1 first commit пре 2 година
README.md 346b78aee1 first commit пре 2 година
package.json 346b78aee1 first commit пре 2 година

README.md

cjk-regex

npm build coverage

regular expression for matching CJK text

Changelog

Install

# using npm
npm install --save cjk-regex

# using yarn
yarn add cjk-regex

Usage

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.

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika