# regexp-helper-core

> regexp-helper-core

Latest version **2.0.13** (published 2026-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install regexp-helper-core
pnpm add regexp-helper-core
yarn add regexp-helper-core
bun add regexp-helper-core
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.13 |
| Published | 2026-09-06 |
| First published | 2018-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 76.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | bluelovers |
| Maintainers | bluelovers |
| Keywords | check, es2018, esnext, flag, flags, helper, is, pattern, re, regex, regexp, regular expression, support, supported, unicode, util, valid, create-by-yarn-tool, create-by-tsdx |

## Links

- npm: https://www.npmjs.com/package/regexp-helper-core
- Repository: https://github.com/bluelovers/ws-regexp
- Homepage: https://github.com/bluelovers/ws-regexp/tree/master/packages/regexp-helper-core#readme
- Issues: https://github.com/bluelovers/ws-regexp/issues
- npm.io page: https://npm.io/package/regexp-helper-core

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.0.13 (latest) — 2026-09-06
- 2.0.12 — 2026-09-06
- 2.0.11 — 2026-09-06
- 2.0.10 — 2024-08-24
- 2.0.9 — 2024-03-01
- 2.0.8 — 2024-01-29
- 2.0.7 — 2023-02-28
- 2.0.2 — 2022-10-26
- 1.0.20 — 2022-10-16
- 1.0.19 — 2021-08-13
- 1.0.18 — 2021-06-21
- 1.0.15 — 2021-02-04
- 1.0.13 — 2020-11-10
- 1.0.12 — 2020-11-10
- 1.0.11 — 2020-07-27
- … 9 more at https://npm.io/package/regexp-helper-core/versions

## README

# regexp-helper-core

> 正規表達式核心工具 (RegExp core utilities)

## install

```bash
# 使用 yarn / Using yarn
yarn add regexp-helper-core

# 使用 yarn-tool / Using yarn-tool
yarn-tool add regexp-helper-core
# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool
yt add regexp-helper-core

# 使用 pnpm / Using pnpm
pnpm add regexp-helper-core

# 使用 npm / Using npm
npm install regexp-helper-core
```

## API

[index.d.ts](index.d.ts)

```ts
export declare const REGEXP_TO_STRING_TAG: string;
export declare function toHex(n: number, toUpperCase?: boolean): string;
/**
 * @code
 * console.log(core.toUnicode('𠮷')); // => \u{20bb7}
 * console.log(core.toUnicode('𠮷'.codePointAt(0)));
 *
 * console.log(core.toUnicode('𠮷', true)); // => \ud842\udfb7
 * console.log(core.toUnicode('𠮷'.codePointAt(0), true));
 *
 * /[𠮷]/u.test('𠮷')
 * /[\u{20bb7}]/u.test('𠮷')
 * /[\ud842\udfb7]/u.test('𠮷')
 */
export declare function toUnicode(charCode: number | string, noMerge?: boolean, wrap?: boolean): string;
export declare function _toUnicode(charCode: number, wrap?: boolean): string;
export declare function isDoubleUnicode(str: string): boolean;
export declare function isRegExp<T extends RegExp>(r: T): T & RegExp;
export declare function isRegExp(r: RegExp): r is RegExp;
export declare function isRegExp(r: any): RegExp | null;
/**
 * @link https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
 * @link https://github.com/ikatyang/regexp-util/blob/7810ce61ff8becd728b745eb6d5c1ca76adfebe0/src/charset.ts#L289
 *
 * @code
 * surrogatePair('𠮷'.codePointAt(0)) // => { h: 55362, l: 57271 }
 * console.log('𠮷'.charCodeAt(0), '𠮷'.charCodeAt(1)) // => 55362 57271
 */
export declare function surrogatePair(codepoint: number): [number, number] & {
    h: number;
    l: number;
};
/**
 * https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
 *
 * @code
 * unicodeUnEscape('\\u{48}\\u{65}\\u{6c}\\u{6c}\\u{6f}\\u{20}\\u{77}\\u{6f}\\u{72}\\u{6c}\\u{64}') // => 'Hello world'
 * unicodeUnEscape('\\u{20bb7}') // => '𠮷'
 */
export declare function unicodeUnEscape(string: string, noLeadingSolidus?: boolean): string;
/**
 * @code
 * unicodeEscape('𠮷') // => '\\u{20bb7}'
 */
export declare function unicodeEscape(string: string, noLeadingSolidus?: boolean, noMerge?: boolean, noWrap?: boolean, filter?: RegExp): string;
import * as self from './index';
declare const _default: Readonly<typeof self>;
export default _default;
```

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