Hi,<br><br>I am trying to use the following snippet of code to print a regex match.<br><br>s = '01234567890123456789x012'<br><br>pat = r'(.*?x|[^a]+)*y'<br><br>mo = re.search(pat, s)<br>if mo is not None:<br>
print mo.group(0)<br><br>By adding one character before the 'x' in the input string, the time taken to print the match doubles. This behaviour is not observed in perl. I am curious to know about the difference the in regex implementations of perl and python which causes this.<br>
<br>Thanks<br>