This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
Generate regular expressions from [regjsparser][regjsparser]’s AST.
## Installation
```sh
npm i regjsgen
```
## API
### `regjsgen.generate(ast)`
This function accepts an abstract syntax tree representing a regular expression (see [regjsparser][regjsparser]), and returns the generated regular expression string.
```js
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);
```
## Support
Tested in Node.js 0.10, 0.12, 4, 6, 8, 10, 12 and 14.<br>