Re: Python's regular expression help

2010-04-29 Thread goldtech
On Apr 29, 11:49 am, Tim Chase wrote: > On 04/29/2010 01:00 PM, goldtech wrote: > > > Trying to start out with simple things but apparently there's some > > basics I need help with. This works OK: > import re > p = re.compile('(ab*)(sss)') > m = p.match( 'absss' ) > > f=r'abss'

Re: Python's regular expression help

2010-04-29 Thread Tim Chase
On 04/29/2010 01:00 PM, goldtech wrote: Trying to start out with simple things but apparently there's some basics I need help with. This works OK: import re p = re.compile('(ab*)(sss)') m = p.match( 'absss' ) f=r'abss' f 'abss' m = p.match( f ) m.group(0) Traceback (most recent call last):

Re: Python's regular expression help

2010-04-29 Thread MRAB
goldtech wrote: Hi, Trying to start out with simple things but apparently there's some basics I need help with. This works OK: import re p = re.compile('(ab*)(sss)') m = p.match( 'absss' ) m.group(0) 'absss' m.group(1) 'ab' m.group(2) 'sss' ... But two questions: How can I operate a regex

Re: Python's regular expression help

2010-04-29 Thread Dodo
Le 29/04/2010 20:00, goldtech a écrit : Hi, Trying to start out with simple things but apparently there's some basics I need help with. This works OK: import re p = re.compile('(ab*)(sss)') m = p.match( 'absss' ) m.group(0) 'absss' m.group(1) 'ab' m.group(2) 'sss' ... But two questions: Ho

Python's regular expression help

2010-04-29 Thread goldtech
Hi, Trying to start out with simple things but apparently there's some basics I need help with. This works OK: >>> import re >>> p = re.compile('(ab*)(sss)') >>> m = p.match( 'absss' ) >>> m.group(0) 'absss' >>> m.group(1) 'ab' >>> m.group(2) 'sss' ... But two questions: How can I operate a regex