Rob Pike wrote a working regex engine in ~30 lines of C in one hour, 1998
blaizedsouza · x · 2026-10-29
A classic programming anecdote: in 1998, Brian Kernighan wanted a regular expression engine small enough to fit on one page of a programming book. Rob Pike went to his office and returned an hour or two later with roughly 30 lines of C.
- It supports ^, $, ., and , using little more than pointers and recursion
- The full implementation is just three functions: match, matchhere, and matchstar
- Kernighan later featured it in Beautiful Code
More from Fun
- Baidu's open OCR model digitizes all 270 pages of an 1899 Merck manual on one GPU — MaziyarPanahi · 2026-10-29
- Wish List: The Grok App, But Backed by My Self-Hosted Hermes Server — intellectronica · 2026-10-29
- Behold: A Cluster Made of Matchbox-Sized Fomu FPGA Boards — zzznah · 2026-10-29
- Company Admits Provoking X Community After Botched AI Release, Credibility 'Speedrun to Zero' — TheZachMueller · 2026-10-29
- AI Circle Meme: Adam Grant's 2x2 Matrix for 'Human Connection' Goes Around — floguo · 2026-10-29
- IT vendor lists $60M AI supercomputer with 9,600 A100 GPUs on eBay — free shipping included — giveen · 2026-10-29