Print

Print


Quoting Jacob Beauregard <[log in to unmask]>:

> Has anyone ever written a regexp expression for matching regexp
> expressions? Is it possible?
>
> I just used a regexp in the most hideous way today because of the lack
> of love for lambdas in PHP 5.2, and somehow this question popped into
> my head.

Not possible.

Parentheses can be nested arbitrarily deep in a regex, so the language  
of regular expressions is not regular.

--Andrew