cjk-regex

regular expression for matching CJK text

MIT 10 个版本
安装
npm install cjk-regex
yarn add cjk-regex
pnpm add cjk-regex
bun add cjk-regex
README

cjk-regex

npm build

regular expression for matching CJK text

Changelog

Install

npm install cjk-regex

Usage

import * as cjk from 'cjk-regex'

const cjkCharset = cjk.all()
cjkCharset.toRegExp().test('a') //=> false
cjkCharset.toRegExp().test('。') //=> true
cjkCharset.toRegExp().test('中') //=> true

const cjkLetterCharset = cjk.letters()
cjkLetterCharset.toRegExp().test('a') //=> false
cjkLetterCharset.toRegExp().test('。') //=> false
cjkLetterCharset.toRegExp().test('中') //=> true

const cjkPunctuationCharset = cjk.punctuations()
cjkPunctuationCharset.toRegExp().test('a') //=> false
cjkPunctuationCharset.toRegExp().test('。') //=> true
cjkPunctuationCharset.toRegExp().test('中') //=> false

Returns a Charset.

Development

# lint
pnpm run lint

# build
pnpm run build

# test
pnpm run test

License

MIT © Ika

版本列表
3.4.0 2025-08-30
3.3.0 2025-03-10
3.2.1 2025-03-08
3.2.0 2025-03-07
3.1.0 2023-10-21
3.0.0 2023-07-09
2.0.1 2021-01-07
2.0.0 2018-03-22
1.0.2 2017-10-14
1.0.1 2017-10-13