Re: Python regexp exclude problem

2011-06-01 Thread MRAB
On 01/06/2011 15:20, Lutfi Oduncuoglu wrote: Hello, I am trying to write a script for adding ip address to a list. Those ip addresses coming thorough from our edge router. I have a line in may script like if any(s not in z2 for s in('144.122.','188.38','193.140.99.2','213.161.144.166','

Re: Python regexp exclude problem

2011-06-01 Thread Christian Heimes
Am 01.06.2011 16:20, schrieb Lutfi Oduncuoglu: > Hello, > > I am trying to write a script for adding ip address to a list. Those ip > addresses coming thorough from our edge router. > I have a line in may script like > > if any(s not in z2 for s > in('144.122.','188.38','193.140.99.2','213

Re: Python RegExp

2005-03-22 Thread D H
[EMAIL PROTECTED] wrote: I have a string which I wish to match using RE, however when I run my comparison (using the match method) on my machine it never returns, using the CPU fully. In your case it may be simpler to just split the string into groups. You don't even need regular expressions or a

Re: Python RegExp

2005-03-22 Thread David Chipping
Jeff, Thanks very much for that, I didn't even consider the option of it finishing, considering I'm using a much slower machine it was running for over 2 minutes when I just killed it! I think I get the rest now. Cheers again, -David On Tue, 22 Mar 2005 17:52:22 -0600, Jeff Epler <[EMAIL PROTE

Re: Python RegExp

2005-03-22 Thread Jeff Epler
On my machine the program finishes in 30 seconds. (it's a 1.5GHz machine) If the 'parm' group is removed, or if the buffer is shortened, the time is reduced considerably. There are "pathological cases" for regular expressions which can take quite a long time. In the case of your expression, it's

Re: Python RegExp

2005-03-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >I have a string which I wish to match using RE, however when I run my > comparison (using the match method) on my machine it never returns, > using the CPU fully. > > The code is (very simply): > > -- > import re > > buffer = r"#1 1 550 111 SYN