Sharedsupport / 2016-10-22-issue1019.sagewsOpen in CoCalc
Author: William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
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