3 ms·
> C++ has built-in regex now and they're pretty damn good too Sadly, `std::regex` is anything but good (poor performance, lack of Unicode support) and should b
by vitaut 2y ago
> C++ has built-in regex now and they're pretty damn good too
Sadly, `std::regex` is anything but good (poor performance, lack of Unicode support) and should be generally avoided.
- yodsanklai 2y agoThe linter used at my work insists on not using it....
- fooker 2y agoIs there something wrong with the specification that causes poor performance?
- steveklabnik 2y agoIt’s ultimately a “won’t break ABI” issue: https://stackoverflow.com/a/70587711 https://stackoverflow.com/a/70587711
- johannes1234321 2y agoThe underlying issue is that for the matches the interface relies a lot on heap allocations for the individual matches, leading to a lot of allocations of small regions to copy from the original input. Many other libraries provide a lot more control there. In benchmarks std::regexp often is a lot slower compared to other implementations, independent from the standard library implementation of choice. The big upside compared to all others is that it's always available. But if there is a choice alternatives are often better.