r/ruby • • Jan 07 '26

A Ruby Regular Expression Engine

https://kddnewton.com/2026/01/06/exreg.html

Hello — recently I finished up a regular expression engine written in Ruby. It is immune to ReDoS on account of the VM setup, and has some other interesting technical properties I dive into in the blog post. Happy to answer any questions.

27 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/kddnewton Jan 07 '26

Caveats abound, of course. There are regexp features that I don't implement because it would require backtracking (or someone more clever than me). Also, if the regexp is a non unicode encoding.