Re: Regex trouble

2009-04-01 Thread akshat agarwal
te_state_machine then i believe (i am > not > > 100% sure) that the ".*?" match requires at least a pushdown automota, > > while ".*" can be handled with a simple finite automaton. > > > > disclaimer: this is all fairly new to me as i just recently impl

Regex trouble

2009-04-01 Thread akshat agarwal
Hi, I am trying to use the following snippet of code to print a regex match. s = '01234567890123456789x012' pat = r'(.*?x|[^a]+)*y' mo = re.search(pat, s) if mo is not None: print mo.group(0) By adding one character before the 'x' in the input string, the time taken to print the match doub