Denis 346b78aee1 first commit il y a 2 ans
..
lib 346b78aee1 first commit il y a 2 ans
CHANGELOG.md 346b78aee1 first commit il y a 2 ans
LICENSE 346b78aee1 first commit il y a 2 ans
README.md 346b78aee1 first commit il y a 2 ans
ThirdPartyNoticeText.txt 346b78aee1 first commit il y a 2 ans
package.json 346b78aee1 first commit il y a 2 ans

README.md

unicode-regex

npm build coverage

regular expression for matching unicode category.

Changelog

Install

# using npm
npm install --save unicode-regex

# using yarn
yarn add unicode-regex

Usage

const unicode = require('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
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika