Generate regular expressions from \href{https://github.com/jviereck/regjsparser}{\texttt{ regjsparser}}’s AST.\hypertarget{md_sfcode_node_modules_regjsgen_README_autotoc_md24128}{}\doxysection{Installation}\label{md_sfcode_node_modules_regjsgen_README_autotoc_md24128}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm i regjsgen }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_regjsgen_README_autotoc_md24129}{}\doxysection{API}\label{md_sfcode_node_modules_regjsgen_README_autotoc_md24129}
\hypertarget{md_sfcode_node_modules_regjsgen_README_autotoc_md24130}{}\doxysubsection{$<$tt$>$regjsgen.\+generate(ast)$<$/tt$>$}\label{md_sfcode_node_modules_regjsgen_README_autotoc_md24130}
This function accepts an abstract syntax tree representing a regular expression (see \href{https://github.com/jviereck/regjsparser}{\texttt{ regjsparser}}), and returns the generated regular expression string.


\begin{DoxyCode}{0}
\DoxyCodeLine{const regjsparser = require('regjsparser');}
\DoxyCodeLine{const regjsgen = require('regjsgen');}
\DoxyCodeLine{}
\DoxyCodeLine{// Generate an AST with `regjsparser`.}
\DoxyCodeLine{let ast = regjsparser.parse(regex);}
\DoxyCodeLine{}
\DoxyCodeLine{// Modify AST}
\DoxyCodeLine{// …}
\DoxyCodeLine{}
\DoxyCodeLine{// Generate `RegExp` string with `regjsgen`.}
\DoxyCodeLine{let regex = regjsgen.generate(ast); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_regjsgen_README_autotoc_md24131}{}\doxysection{Support}\label{md_sfcode_node_modules_regjsgen_README_autotoc_md24131}
Tested in Node.\+js 0.\+10, 0.\+12, 4, 6, 8, 10, 12 and 14.~\newline
 Compatible with regjsparser v0.\+6.\+4’s AST. 