On 3 February 2011 18:30, Nicolas Anquetil <nicolas.anquetil(a)inria.fr> wrote:
not much to do with the real topic, but just wanted to
nastily point out that this is not a regular expression. :-)
PetitParser is not about regular expressions, it parses a much larger
set of languages. For example, languages like a^n b^n or a^b b^n c^n
cannot be detected by regular expressions.
You can specify that you want a particular character
repeated (a+), or that you want anycharacter several repeated (.+)
But I believe regular expression don't allow you to say whatever character comes may
be repeated and only this one ...
No, this is not true. Most today's regular expression engines support
back-references and can easily implement the discussed language:
(.)\1{n}
Lukas
--
Lukas Renggli
www.lukas-renggli.ch