regjsparser

Parsing the JavaScript's RegExp in JavaScript.

BSD-2-Clause 40 个版本
安装
npm install regjsparser
yarn add regjsparser
pnpm add regjsparser
bun add regjsparser
README

RegJSParser

Parsing the JavaScript's RegExp in JavaScript.

Installation

npm install regjsparser

Usage

var parse = require('regjsparser').parse;

var parseTree = parse('^a'); // /^a/
console.log(parseTree);

// Toggle on/off additional features:
var parseTree = parse('^a', '', {
  // SEE: https://github.com/jviereck/regjsparser/pull/78
  unicodePropertyEscape: true,

  // SEE: https://github.com/jviereck/regjsparser/pull/83
  namedGroups: true,

  // SEE: https://github.com/jviereck/regjsparser/pull/89
  lookbehind: true
});
console.log(parseTree);

Testing

To run the tests, run the following command:

npm test

To create a new reference file, execute…

node test/update-fixtures.js

…from the repo top directory.

版本列表
0.13.2 2026-06-13
0.13.1 2026-04-04
0.13.0 2025-09-21
0.12.0 2024-10-30
0.11.2 2024-10-27
0.11.1 2024-10-05
0.11.0 2024-09-18
0.10.0 2023-03-13
0.9.1 2022-07-09
0.9.0 2022-06-26
0.8.4 2022-02-02
0.8.3 2021-12-23
0.8.2 2021-12-14
0.8.1 2021-12-09
0.8.0 2021-12-08
0.7.0 2021-09-06
0.6.9 2021-03-24
0.6.8 2021-03-23
0.6.7 2021-01-30
0.6.6 2021-01-10
0.6.5 2021-01-10
0.6.4 2020-03-11
0.6.3 2020-02-14
0.6.2 2019-12-21
0.6.1 2019-12-13
0.6.0 2018-12-04
0.5.1 2018-11-25
0.5.0 2018-11-25
0.4.0 2018-08-28
0.3.0 2018-01-13
0.2.1 2017-02-23
0.2.0 2016-05-24
0.1.5 2015-08-16
0.1.4 2015-02-27
0.1.3 2014-11-25
0.1.2 2014-08-31
0.1.1 2014-08-30
0.1.0 2014-06-29
0.0.2 2013-11-04
0.0.1 2013-11-03