unicode-regex

4.0.0 • Public • Published

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

Package Sidebar

Install

npm i unicode-regex

Weekly Downloads

33,136

Version

4.0.0

License

MIT

Unpacked Size

552 kB

Total Files

1669

Last publish

Collaborators

  • ikatyang