The author, Russ Cox, has a whole series of articles on the topic of regex - <a href="https://swtch.com/~rsc/regexp/" rel="nofollow">https://swtch.com/~rsc/regexp/</a><p>The rust Regex crate docs even refer to his posts as a reference since the rust version is based on his efficient RE2 Regex implementation at Google.
But if you want faster, (but more complicated):<p><a href="https://github.com/intel/hyperscan" rel="nofollow">https://github.com/intel/hyperscan</a>
Also relevant is Google V8's Irregexp: <a href="https://blog.chromium.org/2009/02/irregexp-google-chromes-new-regexp.html" rel="nofollow">https://blog.chromium.org/2009/02/irregexp-google-chromes-ne...</a>. They claim 3x speedups.
A bit off topic, but here are some Regex benchmarks that might be of interest:<p><a href="https://github.com/mariomka/regex-benchmark" rel="nofollow">https://github.com/mariomka/regex-benchmark</a><p>Surprisingly JS is about 10 times faster than Go.
What I wonder is if the regexps could be preprocessed in a way so that the fast variant is used for all or at least most cases where it it possible to use it.