Re: [Tutor] Regex in Python

2006-07-27 Thread Kent Johnson
The Fulch wrote: > > Thanks for you help, > > Another question, is there a way of comparing two regexs? > > EG > > s1='st*r' > s2='s*ar' > > r1=s1.replace('*','.*') > r2=s2.replace('*','.*') > > re.match(r1,r2)? > That will do something, though I don't know if it is what you want. r1 and r2 are bo

Re: [Tutor] Regex in Python

2006-07-27 Thread The Fulch
Thanks for you help, Another question, is there a way of comparing two regexs? EG s1='st*r's2='s*ar' r1=s1.replace('*','.*')r2=s2.replace('*','.*') re.match(r1,r2)? = Also how do I useĀ  <_sre.SRE_Match object at 0x00E3F6B0> in my program?If its a match, I want to be able to return 'tru