On Thu, 1 Jun 2023 at 18:16, David Mertz, Ph.D. <[email protected]>
wrote:
> OK, fair enough. What about "has whitespace (including Unicode beyond
> ASCII)"?
>
>>> import re
>>> r = re.compile(r'\s', re.U)
>>> r.search('ab\u2002cd')
<re.Match object; span=(2, 3), match='\u2002'>
❯ py -m timeit -s "import re; r = re.compile(r'\s', re.U)"
"r.search('ab\u2002cd')"
1000000 loops, best of 5: 262 nsec per loop
Paul
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/Z7CASFLDWL7N2IPB2QPOWDGALNRBCMF4/
Code of Conduct: http://python.org/psf/codeofconduct/