- Notifications
You must be signed in to change notification settings - Fork13
Generate regular expressions from regjsparser’s AST.
License
NotificationsYou must be signed in to change notification settings
bnjmnt4n/regjsgen
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Generate regular expressions fromregjsparser’s AST.
npm i regjsgen
This function accepts an abstract syntax tree representing a regular expression (seeregjsparser), and returns the generated regular expression string.
constregjsparser=require('regjsparser');constregjsgen=require('regjsgen');// Generate an AST with `regjsparser`.letast=regjsparser.parse(regex);// Modify AST// …// Generate `RegExp` string with `regjsgen`.letregex=regjsgen.generate(ast);
Tested on Node.js 16 and 18.
Compatible with regjsparser v0.10.0’s AST.
About
Generate regular expressions from regjsparser’s AST.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published