unicode-regex

regular expression for matching unicode category

MIT 8 个版本
安装
npm install unicode-regex
yarn add unicode-regex
pnpm add unicode-regex
bun add unicode-regex
README

unicode-regex

npm build

regular expression for matching unicode category.

Changelog

Install

npm install unicode-regex

Usage

import unicode from 'unicode-regex'

const regex = unicode({ General_Category: ['Punctuation'] }).toRegExp()
regex.test('a') //=> false
regex.test('"') //=> true
regex.test('“') //=> true

API

declare function unicode(categories: {
  [category: string]: SubCategory[]
}): Charset

Returns a Charset for further processing, e.g. union, intersect, etc.

(Data from node-unicode-data)

Development

# lint
pnpm run lint

# build
pnpm run build

# test
pnpm run test

License

MIT © Ika

版本列表
4.2.0 2025-08-30
4.1.2 2025-03-08
4.1.0 2025-03-07
4.0.0 2023-07-09
3.0.0 2019-09-29
2.0.0 2018-02-09
1.0.1 2017-11-12
1.0.0 2017-11-12