Re: Freeze problem with Regular Expression

2008-07-01 Thread Kirk
On Mon, 30 Jun 2008 13:43:22 -0700, John Machin wrote: >> I reply here to all of you about such point: that's not important, >> although I appreciate very much your suggestions! My point was >> 'something that works in Perl, has problems in Python'. > > It *is* important; our point was 'you didn'

Re: Freeze problem with Regular Expression

2008-06-30 Thread John Machin
On Jul 1, 12:45 am, Kirk <[EMAIL PROTECTED]> wrote: > On Wed, 25 Jun 2008 15:29:38 -0700, John Machin wrote: > > Several problems: > > Ciao John (and All partecipating in this thread), > first of all I'm sorry for the delay but I was out for business. > > > (1) lose the vertical bars (as advised by

Re: Freeze problem with Regular Expression

2008-06-30 Thread Kirk
On Wed, 25 Jun 2008 15:29:38 -0700, John Machin wrote: > Several problems: Ciao John (and All partecipating in this thread), first of all I'm sorry for the delay but I was out for business. > (1) lose the vertical bars (as advised by others) (2) ALWAYS use a raw > string for regexes; your \s* wi

Re: Freeze problem with Regular Expression

2008-06-26 Thread Peter Pearson
On Thu, 26 Jun 2008 11:20:01 -0500, Peter Pearson wrote: > On 25 Jun 2008 15:20:04 GMT, Kirk <[EMAIL PROTECTED]> wrote: [snip] >> the following regular expression matching seems to enter in a infinite >> loop: [snip] >> import re >> text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX IT

Re: Freeze problem with Regular Expression

2008-06-26 Thread Peter Pearson
On 25 Jun 2008 15:20:04 GMT, Kirk <[EMAIL PROTECTED]> wrote: > Hi All, > the following regular expression matching seems to enter in a infinite > loop: > > > import re > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) > una ' > re.findall('[^A-Z|0-9]*((?:[0

Re: Freeze problem with Regular Expression

2008-06-26 Thread John Machin
On Jun 26, 8:29 am, John Machin <[EMAIL PROTECTED]> wrote: > (2) ALWAYS use a raw string for regexes; your \s* will match on lower- > case 's', not on spaces and should have written: (2) ALWAYS use a raw string for regexes. <<<=== Big fat full stop aka period. but he was at the time only half-wa

Re: Freeze problem with Regular Expression

2008-06-25 Thread John Machin
On Jun 26, 1:20 am, Kirk <[EMAIL PROTECTED]> wrote: > Hi All, > the following regular expression matching seems to enter in a infinite > loop: > > > import re > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) > una ' > re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[

Re: Freeze problem with Regular Expression

2008-06-25 Thread Maric Michaud
Le Wednesday 25 June 2008 18:40:08 cirfu, vous avez écrit : > On 25 Juni, 17:20, Kirk <[EMAIL PROTECTED]> wrote: > > Hi All, > > the following regular expression matching seems to enter in a infinite > > loop: > > > > > > import re > > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl

RE: Freeze problem with Regular Expression

2008-06-25 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Kirk > Sent: Wednesday, June 25, 2008 11:20 AM > To: python-list@python.org > Subject: Freeze problem with Regular Expression > > Hi All, > the following regular e

Re: Freeze problem with Regular Expression

2008-06-25 Thread cirfu
On 25 Juni, 17:20, Kirk <[EMAIL PROTECTED]> wrote: > Hi All, > the following regular expression matching seems to enter in a infinite > loop: > > > import re > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) > una ' > re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[0

Freeze problem with Regular Expression

2008-06-25 Thread Kirk
Hi All, the following regular expression matching seems to enter in a infinite loop: import re text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) una ' re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[0-9|a-z|\-]*)+\s*[a-z]*\s*(?:[0-9] *[A-Z]+[0-9|a-z|\-]*\s*)*)([^A-Z