# magic-regexp

> A compiled-away, type-safe, readable RegExp alternative

Latest version **0.11.0** (published 2026-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install magic-regexp
pnpm add magic-regexp
yarn add magic-regexp
bun add magic-regexp
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.11.0 |
| Published | 2026-03-05 |
| First published | 2022-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 92.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4337 |
| Maintainers | danielroe |

## Links

- npm: https://www.npmjs.com/package/magic-regexp
- Repository: https://github.com/unjs/magic-regexp
- Homepage: https://regexp.dev
- Issues: https://github.com/unjs/magic-regexp/issues
- npm.io page: https://npm.io/package/magic-regexp

## Dependencies (4)

- [unplugin](https://npm.io/package/unplugin.md) ^3.0.0
- [regexp-tree](https://npm.io/package/regexp-tree.md) ^0.1.27
- [magic-string](https://npm.io/package/magic-string.md) ^0.30.21
- [type-level-regexp](https://npm.io/package/type-level-regexp.md) ~0.1.17

## Recent versions

- 0.11.0 (latest) — 2026-03-05
- 0.10.0 — 2025-04-21
- 0.9.0 — 2025-04-09
- 0.8.0 — 2024-03-07
- 0.7.0 — 2023-05-05
- 0.6.3 — 2023-02-28
- 0.6.2 — 2023-01-29
- 0.6.1 — 2022-11-16
- 0.6.0 — 2022-10-28
- 0.5.0 — 2022-09-16
- 0.4.1 — 2022-08-05
- 0.4.0 — 2022-07-25
- 0.3.0 — 2022-07-20
- 0.2.3 — 2022-07-18
- 0.2.2 — 2022-07-18
- … 8 more at https://npm.io/package/magic-regexp/versions

## README

# 🦄 magic-regexp

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]
[![Bundlephobia][bundlephobia-src]][bundlephobia-href]
[![nuxt.care health](https://img.shields.io/endpoint?url=https://nuxt.care/api/badge/magic-regexp)](https://nuxt.care/?search=magic-regexp)

> A compiled-away, type-safe, readable RegExp alternative

- [✨ &nbsp;Changelog](https://github.com/danielroe/magic-regexp/blob/main/CHANGELOG.md)
- [📖 &nbsp;Documentation](https://regexp.dev)
- [▶️ &nbsp;Online playground](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYwBYEMoBoVQKbox4BKeA5gKIAeYOAJsGcDDnlesjADYCeOI6HgCM8OCADs8AeSgBZaKLgB3aHQDCGKHAC+cAGZQIIOAHIBTZAFp8ZNmBMAoBwHoAVK4dxXKDONtwYCE9vUEhYRAA6KN0DI1NzYCsbO2c9AFdYVDwoSwTkRy8AiACoHgCeMDw4LjwANzwuOFJKGjgBGDQ4fABnNK4YbrgACjts0DxxGHQuAEpg5ydnZzgAFQq8OhR0MBgMqrJDNLBuh2QJbvgASQARAH1iCjgAXlwCImbqMBH2Tl4hk2AdEsJhmEXQ4joQwYTBgERg426QwArKCDhAjhsAIKIgF0EEzOZncQXOBoo6DF4mbpGKqAywAJgAzAAWACcAAY4Fl8Mp9hATBF2mghjd7hQZgB+CJk44uZZwBVwAB6EsWywAimlEgBrSzgoEMWBlbp4ED1KCnc7wADKFFkADUKMQxc9XoQSORPkNPHAJNI5AooYxmKjDpU6Nj-gIAFbQEFYH0CkwJhV+mTyfBBmGh9HhyNmYDiOMzFNtQQif4RZO+yTpwNoTA5jERnFgQhofEJuYOW0Op1iuXK1WW4nwHp9eAvZD4d0fGjfDjcHj-PQQCDOIgXCLR7ogsF6IhQf5CTDOfFwvAXY+n1frzewncgtVNPB6bITZCXopwMD4WrAdFul4LYdj2TYZUGNJukLMgAiyUkwzgcR0BAPARxJFYKAAOQoFYXSnGd3k9ecfTYRc-hUKB1E0aUwyxHE9GAKALg0TB42UVRWKgWjc3o-4TSJai2JLGt-QzPAhgbKACR9BUwQhCJ8DffBxE-FYIH4vBBK4p9FTgeS6EU1931UvB1JXJiWM0eMHG7IkSXHfp6VdTCcLwh4LyvExXIAHieJ4pH8gA+NyQSAA)

## Features

- Runtime is zero-dependency and ultra-minimal
- Ships with transform to compile to pure RegExp
- Automatically typed capture groups
- Natural language syntax
- Generated RegExp displays on hover

[📖 &nbsp;Read more](https://regexp.dev)

## 💻 Development

- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

## Similar packages

- [verbal-expressions](http://verbalexpressions.github.io/)
- [typed-regex](https://github.com/phenax/typed-regex/)

## License

Made with ❤️

Published under [MIT License](./LICENCE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/magic-regexp?style=flat-square
[npm-version-href]: https://npmx.dev/package/magic-regexp
[npm-downloads-src]: https://img.shields.io/npm/dm/magic-regexp?style=flat-square
[npm-downloads-href]: https://npmx.dev/package/magic-regexp
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/danielroe/magic-regexp/ci.yml?branch=main&style=flat-square
[github-actions-href]: https://github.com/danielroe/magic-regexp/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/danielroe/magic-regexp/main?style=flat-square
[codecov-href]: https://codecov.io/gh/danielroe/magic-regexp
[bundlephobia-src]: https://img.shields.io/bundlephobia/minzip/magic-regexp?style=flat-square
[bundlephobia-href]: https://bundlephobia.com/package/magic-regexp

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