Advertisement
Guest User

Comparing re.match and re.search

a guest
Mar 12th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. In [4]: timeit.timeit("re.search('^spam', 'spamming a useless string of random junk')",setup="import re")
  2. Out[4]: 0.8193864339991705
  3.  
  4. In [5]: timeit.timeit("re.match('spam', 'spamming a useless string of random junk')",setup="import re")
  5. Out[5]: 1.3379552369988232
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement