Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

babel/regjsparser

Repository files navigation

RegJSParser

This is a fork of jviereck/regjsparser with some additional patches. The end goal is to merge these patches upstream.

Parsing the JavaScript's RegExp in JavaScript.

Installation

npm install @babel/regjsparser

Usage

var parse = require('@babel/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.

About

Parsing the JavaScript's RegExp in JavaScript.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages

  • JavaScript 94.7%
  • TypeScript 4.0%
  • HTML 1.3%

AltStyle によって変換されたページ (->オリジナル) /