import re, time
text = " a b "
pat = re.compile( ".*a.*?b.*" )
t1 = time.time()
for i in range( 500000 ):
x = pat.match( text )
t2=time.time()
print( (t2-t1)*1000 )
aW1wb3J0IHJlLCB0aW1lCnRleHQgPSAiICAgICAgICAgICAgIGEgICAgICAgICAgICAgICAgICAgICAgYiAgICAgICAgICAgICAgICAgICAgICAiCnBhdCA9IHJlLmNvbXBpbGUoICIuKmEuKj9iLioiICkKdDEgPSB0aW1lLnRpbWUoKQpmb3IgaSBpbiByYW5nZSggNTAwMDAwICk6Cgl4ID0gcGF0Lm1hdGNoKCB0ZXh0ICkKdDI9dGltZS50aW1lKCkKcHJpbnQoICh0Mi10MSkqMTAwMCAp