In message "[ruby-talk:9035] Re: Regexp for matching Ruby reg exps?"
on 01/01/10, "Ben Tilly" <ben_tilly / hotmail.com> writes:
>A Ruby regexp can contain any set of balanced parens.
>Balanced parens are a classic problem that is unsolvable
>in a regular expression.
# Note: this message isn't practical but may be a pazzle :-)
Ruby's regexp is extended rather than the theoretical one. So, this
problem is solvable in Ruby perhaps. Indeed, a Perl's regexp for a
kind of balanced parens, i.e. email address, is known (e.g. appears in
Jeffrey E. F. Friedl's book).
On the other hand, writing negative pattern in Ruby's regexp is very
difficult sometimes. So, I think there slightly is a gap between the
classic problem and that sort of explanation.
-- Gotoken