Re:Faster Python with Guido van Rossum
by makapuf on Thursday October 07, 2021 @04:41PM
(#28791765)
That's where pcre2 is called (or a finely tuned regex c lib)
[ Parent
| on HN ]
re is an ordinary standard Python library —
https://docs.python.org/3/library/re.html
pcre2 is not —
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
re depends ultimately of this c file https://github.com/python/cpython/blob/main/Modules/_sre.c
And? CPython is implemented in C.
Here's some of a comment from _operator.c
"This module exports a set of functions implemented in C corresponding\n\ to the intrinsic operators of Python. For example, operator.add(x, y)\n\ is equivalent to the expression x+y."
Why wouldn't you expect that CPython regex would "ultimately" be written in C?