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

README.md

RegJSGen

Generate RegExps from RegJSParsers 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

twitter/demoneaux
Benjamin Tan

Contributors

twitter/mathias
Mathias Bynens