Socket
Socket
Sign inDemoInstall

unicode-regex

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unicode-regex

regular expression for matching unicode category


Version published
Weekly downloads
37K
increased by16.81%
Maintainers
1
Install size
637 kB
Created
Weekly downloads
 

Changelog

Source

4.0.0 (2023-07-09)

Build System

  • update infra (#298) (4270f16)

Features

BREAKING CHANGES

  • upgrade Unicode data from v12.1.0 to v15.0.0
  • this package is now pure ESM

<a name="3.0.0"></a>

Readme

Source

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

Keywords

FAQs

Last updated on 09 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc