You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michael Winter 555e2c196e | 5 years ago | |
---|---|---|
.. | ||
LICENSE.txt | 5 years ago | |
README.md | 5 years ago | |
package.json | 5 years ago | |
regjsgen.js | 5 years ago |
README.md
RegJSGen
Generate RegExp
s from RegJSParser’s AST.
Installation
npm install --save regjsgen
Usage
var regjsgen = require('regjsgen');
// With `regjsparser`
var regjsparser = require('regjsparser');
var regex = '^a$';
var ast = regjsparser.parse(regex);
// Modify AST
// ...
// Regenerate `RegExp`
regex = regjsgen.generate(ast);
See Also
Testing
Run the command
npm test
To create a new reference file, execute
node test/update-fixture.js
from the repo top directory.
Support
Tested in Node.js 0.8.26~0.10.30.
Author
Benjamin Tan |
Contributors
Mathias Bynens |