Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by devanshp on Tuesday May 19, 2026 @12:36AM
(#48189215)
This is absurd. I did not realize you could do nearly this much computation in regex.
[ Parent
| on HN ]
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by tgv on Tuesday May 19, 2026 @03:01AM
(#48190174)
It's not just regex. The regular expressions are used to select and perform an action. There's a loop around it with controls the stack. That has more power than the regex.
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by karlgkk on Tuesday May 19, 2026 @12:37AM
(#48189224)
It’s turing complete so you could compile almost any language to regex. You might have to build a vm for some languages, also in regex. The point is, it’s regex all the way down.
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by Patryk27 on Tuesday May 19, 2026 @02:18AM
(#48189866)
Regular expressions are not Turing-complete.
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by 0xffany on Tuesday May 19, 2026 @02:45AM
(#48190045)
True in the CS Theory space, but most modern regex engines implement a few niceties which make their "regex" turing complete.
https://blog.poisson.chat/posts/2024-06-18-turing-regex.html
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by benchloftbrunch on Tuesday May 19, 2026 @08:20AM
(#48192363)
Javascript/PCRE/etc regexes have additional features (like backreferences) that give them strictly more computational power than a regular DFA/NFA. (Still not Turing complete though without external control flow to support arbitrary iteration/recursion, like is done here)
Re:Regex Chess: A 2-ply minimax chess engine in 84,688 regul...
by casey2 on Wednesday May 20, 2026 @08:18AM
(#48206503)
This is an odd comment because it's a famously (imo) over known fact due to cs textbooks and how academia organizes knowledge, optimizing for pushing papers over genuine discovery.