$ npm install unicode-regex
regular expression for matching unicode category.
npm install unicode-regex
import unicode from 'unicode-regex'
const regex = unicode({ General_Category: ['Punctuation'] }).toRegExp()
regex.test('a') //=> false
regex.test('"') //=> true
regex.test('“') //=> true
declare function unicode(categories: {
[category: string]: SubCategory[]
}): Charset
Returns a Charset for further processing, e.g. union, intersect, etc.
(Data from node-unicode-data
)
# lint
pnpm run lint
# build
pnpm run build
# test
pnpm run test
MIT © Ika
© 2010 - cnpmjs.org x YWFE | Home | YWFE