JavaScriptでは、他の正規表現の観点から正規表現を定義して、各正規表現を再帰的に定義することはできますか?
たとえば、JavaScriptプログラミング言語の文法のごく一部を表すために、これらの正規表現(相互に定義されている)を使用したいと思います。
<functionDefinition> = function <functionName>(<parameterList>){statementList}
<statementList> = (<functionDefinition>| ... other valid statements go here ... ) //a series of JavaScript statements or function definitions
//each of these regular expressions are defined in terms of the others, allowing them to be infinitely nested