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 | 6 years ago | |
---|---|---|
.. | ||
LICENSE.txt | 6 years ago | |
README.md | 6 years ago | |
package.json | 6 years ago | |
regjsgen.js | 6 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 |