Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Generate regular expressions from regjsparser’s AST.

License

NotificationsYou must be signed in to change notification settings

bnjmnt4n/regjsgen

Repository files navigation

Generate regular expressions fromregjsparser’s AST.

Installation

npm i regjsgen

API

regjsgen.generate(ast)

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);

Support

Tested on Node.js 16 and 18.
Compatible with regjsparser v0.10.0’s AST.


[8]ページ先頭

©2009-2025 Movatter.jp