unicode-regex
regular expression for matching unicode category.
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
yarn lint
# build
yarn build
# test
yarn test
License
MIT Ika