I'd love for someone to add this to rebar[1] so that we can get a good sense of how well it does against other general purpose regex engines. It will be a little tricky to add (since the build step will require emitting a C++ program and compiling it), but it should be possible.<p>[1]: <a href="https://github.com/BurntSushi/rebar">https://github.com/BurntSushi/rebar</a>
It's a good library but be careful as it can significantly increase compile times. I added a couple of reasonably long regular expressions to a c++ source file and it increased the compile time from near instant (below to 1 second) to 30 seconds. Might be wise to move these to dedicated source files so you don't pay this penalty each time you make changes.
Boost Xpressive has had static/"compile time" regex in C++ since the mid 2000s<p><a href="https://www.boost.org/doc/libs/1_83_0/doc/html/xpressive.html" rel="nofollow noreferrer">https://www.boost.org/doc/libs/1_83_0/doc/html/xpressive.htm...</a><p>A performance comparison would be interesting.
D has ctRegex since a decade ago <a href="https://dlang.org/phobos/std_regex.html#ctRegex" rel="nofollow noreferrer">https://dlang.org/phobos/std_regex.html#ctRegex</a>
Since people is posting other lang implementations... someone did it for zig too (probably less polished than this C++ lib) [0]. It is nice that the regexes can be used at compile time too [1].<p>--<p>0: <a href="https://github.com/alexnask/ctregex.zig">https://github.com/alexnask/ctregex.zig</a><p>1: I think the difference between C++ template language and Zig comptime is that Zig's comptime is almost equal as Zig's regular language, whereas the experience of programming C++ templates almost feels like learning a separate, equally complex language.
This has been available in Lisp since at least 2004.<p><a href="https://github.com/edicl/cl-ppcre/">https://github.com/edicl/cl-ppcre/</a>
This has been a part of the dlang standard library for some time: <a href="https://dlang.org/phobos/std_regex.html" rel="nofollow noreferrer">https://dlang.org/phobos/std_regex.html</a>