# unicode-regex

> regular expression for matching unicode category

Latest version **4.3.0** (published 2026-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install unicode-regex
pnpm add unicode-regex
yarn add unicode-regex
bun add unicode-regex
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.3.0 |
| Published | 2026-09-16 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 878.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | Ika |
| Maintainers | fisker, ikatyang |
| Keywords | regular-expression, unicode |

## Links

- npm: https://www.npmjs.com/package/unicode-regex
- Repository: https://github.com/ikatyang-collab/unicode-regex
- Homepage: https://github.com/ikatyang-collab/unicode-regex#readme
- Issues: https://github.com/ikatyang-collab/unicode-regex/issues
- npm.io page: https://npm.io/package/unicode-regex

## Dependencies (1)

- [regexp-util](https://npm.io/package/regexp-util.md) ^2.1.0

## Recent versions

- 4.3.0 (latest) — 2026-09-16
- 4.2.3 — 2026-09-12
- 4.2.2 — 2026-09-12
- 4.2.0 — 2025-08-30
- 4.1.2 — 2025-03-08
- 4.1.0 — 2025-03-07
- 4.0.0 — 2023-07-09
- 3.0.0 — 2019-09-29
- 2.0.0 — 2018-02-09
- 1.0.1 — 2017-11-12
- 1.0.0 — 2017-11-12

## README

# unicode-regex

[![npm](https://img.shields.io/npm/v/unicode-regex.svg)](https://www.npmjs.com/package/unicode-regex)
[![build](https://img.shields.io/github/actions/workflow/status/ikatyang/unicode-regex/test.yml)](https://github.com/ikatyang/unicode-regex/actions?query=branch%3Amain)

regular expression for matching unicode category.

[Changelog](https://github.com/ikatyang/unicode-regex/blob/main/CHANGELOG.md)

## Install

```sh
npm install unicode-regex
```

## Usage

```js
import unicode from 'unicode-regex'

const regex = unicode({ General_Category: ['Punctuation'] }).toRegExp()
regex.test('a') //=> false
regex.test('"') //=> true
regex.test('“') //=> true
```

## API

```ts
declare function unicode(categories: {
  [category: string]: SubCategory[]
}): Charset
```

Returns a [Charset](https://github.com/ikatyang/regexp-util#charset) for further processing, e.g. union, intersect, etc.

(Data from [`node-unicode-data`](https://github.com/mathiasbynens/node-unicode-data))

## Development

```sh
# lint
yarn lint

# build
yarn build

# test
yarn test
```

## License

MIT © [Ika](https://github.com/ikatyang)

---
_Source: https://npm.io/package/unicode-regex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
