Re: string search and modification

2006-09-07 Thread John Machin
Jim Britain wrote: > > Final integration: > > def identifyHost(self): > for line in self.fileContents: > if re.search("throttling", line.lower()): > p=r'\[((\d{1,3}\.){3}\d{1,3})\]' > ip=re.search(p,line) A prudent pessimist might test

Re: string search and modification

2006-09-07 Thread Jim Britain
On 06 Sep 2006 13:23:43 -0700, Paul Rubin wrote: >Jim Britain <[EMAIL PROTECTED]> writes: >> I would like to match [123.123.123.123] (including the qualifying >> brackets), but be able to simply return the contents, without the >> brackets. > > > >>> p=r'\[((\d{1,3}\.){3

Re: string search and modification

2006-09-06 Thread Paul Rubin
Jim Britain <[EMAIL PROTECTED]> writes: > I would like to match [123.123.123.123] (including the qualifying > brackets), but be able to simply return the contents, without the > brackets. >>> p=r'\[((\d{1,3}\.){3}\d{1,3})\]' >>> m = 'dsl-kk-dynamic-013.38.22.125.touchtelindia.net [125.22.38.13]

string search and modification

2006-09-06 Thread Jim Britain
I know absolutely nothing about Python. My background is shell scripts assembly language and C programming. Currently I work network support. This is a portion of a Python script written by aaronsinclair. the full script can be found at: http://forums.ev1servers.net/printthread.php?t=50435&pa