CoCalc Public Filessupport / 2016-10-22-issue1019.sagewsOpen in with one click!
Author: William A. Stein
Description: Jupyter notebook support/2015-06-04-141749-bokeh.ipynb
import re s = 'lljdfjlajsdffoo*lkajdsfl?ajsdf' %timeit re.search('[\?\*]', s) %timeit '?' in s or '*' in s
625 loops, best of 3: 1.19 µs per loop 625 loops, best of 3: 70.6 ns per loop
import re s = 'lljdfjlajsdffoolkajdsflajsdf' %timeit re.search('[\?\*]', s) %timeit '?' in s or '*' in s
625 loops, best of 3: 1.16 µs per loop 625 loops, best of 3: 126 ns per loop