Re: more than 100 capturing groups in a regex

2005-10-27 Thread Tim Peters
[DH] >> It's a conflict between python's syntax for regex back references >> and octal number literals. Probably wasn't noticed until way too >> ate, and now it will never change. [EMAIL PROTECTED] > I suspect it comes from Perl, since Python's regular expression engine tries > pretty hard to be

Re: more than 100 capturing groups in a regex

2005-10-27 Thread skip
DH> It's a conflict between python's syntax for regex back references DH> and octal number literals. Probably wasn't noticed until way too DH> late, and now it will never change. I suspect it comes from Perl, since Python's regular expression engine tries pretty hard to be compatible

Re: more than 100 capturing groups in a regex

2005-10-27 Thread Joerg Schuster
> It's a conflict between python's syntax for regex back > references and > octal number literals. Probably wasn't noticed until way > too late, and > now it will never change. So "reasonable choice" is not a really good description of the phenomenon. -- http://mail.python.org/mailman/listinfo/

Re: more than 100 capturing groups in a regex

2005-10-26 Thread D H
Fredrik Lundh wrote: > Joerg Schuster wrote: > > >>>if you want to know why 100 is a reasonable and non-random choice, I >>>suggest checking the RE documentation for "99 groups" and the special >>>meaning of group 0. >> >>I have read everything I found about Python regular expressions. But I >>am

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Peter Hansen
Joerg Schuster wrote: > So what? Search in http://docs.python.org/lib/re-syntax.html for "99" and read the following sentence carefully. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Joerg Schuster
... solution -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Joerg Schuster
My first test program was far too naive. Evil things do happen. Simply removing the code that restricts the number of capturing groups to 100 is not a solitution. -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-26 Thread André Malo
* "Iain King" <[EMAIL PROTECTED]> wrote: > Ah, doh! Of course. Oh well then... still, doesn't python's RE > engine support named groups? That would be cumbersome, but would allow > you to go above 100... The named groups are built on top of numbered captures. They are mapped by the parser and

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Iain King
Fredrik Lundh wrote: > Iain King wrote: > > > Anyway, back to the OP: in this specific case, the cap of 100 groups in > > a RE seems random to me, so I think the rule applies. > > perhaps in the "indistinguishable from magic" sense. > > if you want to know why 100 is a reasonable and non-random ch

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Joerg Schuster
So what? -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Fredrik Lundh
Joerg Schuster wrote: > > if you want to know why 100 is a reasonable and non-random choice, I > > suggest checking the RE documentation for "99 groups" and the special > > meaning of group 0. > > I have read everything I found about Python regular expressions. But I > am not able to understand wh

Re: more than 100 capturing groups in a regex

2005-10-26 Thread Joerg Schuster
> if you want to know why 100 is a reasonable and non-random choice, I > suggest checking the RE documentation for "99 groups" and the special > meaning of group 0. I have read everything I found about Python regular expressions. But I am not able to understand what you mean. What is so special ab

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Fredrik Lundh
Iain King wrote: > Anyway, back to the OP: in this specific case, the cap of 100 groups in > a RE seems random to me, so I think the rule applies. perhaps in the "indistinguishable from magic" sense. if you want to know why 100 is a reasonable and non-random choice, I suggest checking the RE doc

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Iain King
Steven D'Aprano wrote: > On Tue, 25 Oct 2005 06:30:35 -0700, Iain King wrote: > > > > > Steven D'Aprano wrote: > >> On Tue, 25 Oct 2005 05:17:52 -0700, Iain King wrote: > >> > >> > > >> > Fredrik Lundh wrote: > >> >> Joerg Schuster wrote: > >> >> > >> >> > I just want to use more than 100 capturin

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 06:30:35 -0700, Iain King wrote: > > Steven D'Aprano wrote: >> On Tue, 25 Oct 2005 05:17:52 -0700, Iain King wrote: >> >> > >> > Fredrik Lundh wrote: >> >> Joerg Schuster wrote: >> >> >> >> > I just want to use more than 100 capturing groups. >> >> >> >> define "more" (101, 20

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Iain King
Steven D'Aprano wrote: > On Tue, 25 Oct 2005 05:17:52 -0700, Iain King wrote: > > > > > Fredrik Lundh wrote: > >> Joerg Schuster wrote: > >> > >> > I just want to use more than 100 capturing groups. > >> > >> define "more" (101, 200, 1000, 10, ... ?) > >> > >> > > > > The Zero-One-Infinity Ru

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
You did not quite understand me. I will give you some details: My program is a compiler for a certain type of linguistic grammars. I.e. the user gives *grammar files* to my program. When the grammar files have been compiled, they can be applied to strings (of a certain language, e.g. English). In

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 05:17:52 -0700, Iain King wrote: > > Fredrik Lundh wrote: >> Joerg Schuster wrote: >> >> > I just want to use more than 100 capturing groups. >> >> define "more" (101, 200, 1000, 10, ... ?) >> >> > > The Zero-One-Infinity Rule: > > http://www.catb.org/~esr/jargon/html/Z

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Jorge Godoy
"Joerg Schuster" <[EMAIL PROTECTED]> writes: >> but what is the reason for so much capturing groups? I >> imagine that coding this and keeping code maintenable is a huge effort. > > User input is compiled to regular expressions. The user does not have > to worry about those groups. And what is t

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Iain King
Fredrik Lundh wrote: > Joerg Schuster wrote: > > > I just want to use more than 100 capturing groups. > > define "more" (101, 200, 1000, 10, ... ?) > > The Zero-One-Infinity Rule: http://www.catb.org/~esr/jargon/html/Z/Zero-One-Infinity-Rule.html Iain -- http://mail.python.org/mailman/li

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
> The joys of open source. Just remember you have now > made your program > non-portable. Hope this isn't an issue. Of course portability is an issue -- on the long run. But on the short run I am really glad to be able to do a 1 second demo run on my notebook instead of a 20 seconds demo run. And

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 03:55:17 -0700, Joerg Schuster wrote: > No limitation at all would be best. If a limitation is necessary, then > the more capturing groups, the better. At the time being, I would be > really happy about having the possibility to use 1 capturing > groups. Do you really thin

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
> but what is the reason for so much capturing groups? I > imagine that coding this and keeping code maintenable is a huge effort. User input is compiled to regular expressions. The user does not have to worry about those groups. -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steve Holden
Joerg Schuster wrote: >>What happens if you up the limit to whatever you need? > > > Good idea. I just tried this. Nothing evil seems to happen. This seems > to be a solution. Thanks. > > Jörg > The joys of open source. Just remember you have now made your program non-portable. Hope this isn't

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Jorge Godoy
"Joerg Schuster" <[EMAIL PROTECTED]> writes: > No limitation at all would be best. If a limitation is necessary, then > the more capturing groups, the better. At the time being, I would be > really happy about having the possibility to use 1 capturing > groups. I'm sorry, I missed the beginni

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
No limitation at all would be best. If a limitation is necessary, then the more capturing groups, the better. At the time being, I would be really happy about having the possibility to use 1 capturing groups. Jörg -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Fredrik Lundh
Joerg Schuster wrote: > I just want to use more than 100 capturing groups. define "more" (101, 200, 1000, 10, ... ?) -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
> What happens if you up the limit to whatever you need? Good idea. I just tried this. Nothing evil seems to happen. This seems to be a solution. Thanks. Jörg -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Frithiof Andreas Jensen
"Joerg Schuster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Some people, when confronted with a problem, think "I know, > I'll use regular expressions." Now they have two problems. > --Jamie Zawinski Thanks for the citation. If my goal had been to redesign my program, I would

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Frithiof Andreas Jensen
"Joerg Schuster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, Python regular expressions must not have more than 100 capturing groups. Really ?? I have been waiting a long time now for Python to get rid of this limitation. Ahh - The "dark side" of Open Source: If nobody

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Peter Hansen
Joerg Schuster wrote: > I just want to use more than 100 capturing groups. If someone told me > that it is very unlikely for Python to get rid of the said limitation, > I would recode part of my program in C++ using pcre. It is very unlikely for Python to get rid of the said limitation. -Peter -

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
> Some people, when confronted with a problem, think "I know, > I'll use regular expressions." Now they have two problems. > --Jamie Zawinski Thanks for the citation. If my goal had been to redesign my program, I would not ask questions about regular expressions. I do not have the time to redesig

Re: more than 100 capturing groups in a regex

2005-10-24 Thread skip
Joerg> Or is there a way to circumvent [capturing groups limitation]? Sure, submit a patch to SourceForge that removes the restriction. I've never come anywhere close to creating regular expressions that need to capture 100 groups even though I generate regular expressions from a higher-level

more than 100 capturing groups in a regex

2005-10-24 Thread Joerg Schuster
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: get rid of this limitation! if p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named