Nicholas Carlini has built a chess engine that operates entirely using regular expressions. The project is named "Regex Chess."
This engine executes a sequence consisting of 84,688 regular expressions. When a board state is input, it outputs a valid move based on a 2-ply minimax algorithm.
Carlini employed a method of simulating a computer using regular expressions. Specifically, he designed a system for branchless execution, conditional execution, and a SIMD instruction set, creating a mechanism to interpret these via regular expressions. He explained that this is similar to GPUs or ARM instruction sets.
The state of the program is represented by including the program stack and variables within a single string. Each regular expression performs pattern matching and substitution on this string.
The code has been made public on GitHub. Carlini stated that he created this project as something "completely pointless."
Sources: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions (HN 184pt, 51 comments) (HN Search (backfill), 2026-05-15)