cjk-regex
regular expression for matching CJK text
Last updated 2 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install cjk-regex 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.5.0                                ...           latest (2 months ago)

13 Versions

  • 3.5.0                                ...           2 months ago
  • 3.4.2                                ...           3 months ago
  • 3.4.1                                ...           3 months ago
  • 3.4.0                                ...           a year ago
  • 3.3.0                                ...           2 years ago
  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
Maintainers (2)
Downloads
Total 50
Today 0
This Week 1
This Month 43
Last Day 0
Last Week 20
Last Month 7
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE