forked fromjviereck/regjsparser
- Notifications
You must be signed in to change notification settings - Fork0
Parsing the JavaScript's RegExp in JavaScript.
License
NotificationsYou must be signed in to change notification settings
babel/regjsparser
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a fork ofjviereck/regjsparser with some additional patches. The end goal is to merge these patches upstream.
Parsing the JavaScript's RegExp in JavaScript.
npm install @babel/regjsparser
varparse=require('@babel/regjsparser').parse;varparseTree=parse('^a');// /^a/console.log(parseTree);// Toggle on/off additional features:varparseTree=parse('^a','',{// SEE: https://github.com/jviereck/regjsparser/pull/78unicodePropertyEscape:true,// SEE: https://github.com/jviereck/regjsparser/pull/83namedGroups:true,// SEE: https://github.com/jviereck/regjsparser/pull/89lookbehind:true});console.log(parseTree);
To run the tests, run the following command:
npmtest
To create a new reference file, execute…
node test/update-fixtures.js
…from the repo top directory.