3 ms·
Thanks for pointing this out. I wrote a Python test program but forgot to run that test in the data collection for the graphs. I will update them once the tests
by rsc 9y ago
Thanks for pointing this out. I wrote a Python test program but forgot to run that test in the data collection for the graphs. I will update them once the tests finish running. Ironically, Python must be passing the glob to an exponential-time regexp library, since Python is on the slow side of the fence.
- willvarfar 9y agoRuss, while you're around, thanks for re2! RE2::Set especially! But why is RE2::Set so underdocumented and underpromoted? All regex libraries need this functionality.
- rsc 9y agoYou're welcome. I think basically all of RE2 is underdocumented and underpromoted. Why should RE2::Set be any different? Seriously, though, it was a bit of an afterthought. A team at Google was |ing together a ton of regexps and came to me for something better, so I wrote RE2::Set. I'm glad it helps others too.
- js2 9y agoYour previous article on regex engines I think indicated that Python's is backtracking and with poor performance.
- rsc 9y agoIndeed, I just didn't want to presume that nothing had changed in the past 10 years (but apparently not).
- dom0 9y agoYep, Python's "re" is the usual PCRE+X story.
- js2 9y agoPython has its own engine which is not based on PCRE AFAIK: https://github.com/python-git/python/blob/715a6e5035bb21ac49382772076ec4c630d6e960/Modules/_sre.c https://github.com/python-git/python/blob/715a6e5035bb21ac49...
- xapata 9y agoI noticed you linked to python-git instead of the main Python repo. The whole project has been moved as of a couple months. https://github.com/python/cpython https://github.com/python/cpython
- js2 9y agoYeah, that was a mistake on my part but by the time somone pointed it out I couldn't edit my comment anymore. Sorry. :-(
- ot 9y agoPython's regex library compiles the regex to a sequence of opcodes and then does recursive descent, so yes, it's exponential.