@TrisH0x2A: Rob Pike wrote a complete regular expression matcher in about 30 lines of C it supports ^, ., *, and $ using only recur…

X AI KOLs Timeline News

Summary

A tweet highlights Rob Pike's classic 30-line regular expression matcher in C, demonstrating recursion and pointer arithmetic as an introduction to regex engines.

Rob Pike wrote a complete regular expression matcher in about 30 lines of C it supports ^, ., *, and $ using only recursion and pointer arithmetic it's still one of the best introductions to how regex engines actually work https://t.co/4RzVArGpUs
Original Article
View Cached Full Text

Cached at: 08/04/26, 04:01 AM

Rob Pike wrote a complete regular expression matcher in about 30 lines of C

it supports ^, ., *, and $ using only recursion and pointer arithmetic

it’s still one of the best introductions to how regex engines actually work https://t.co/4RzVArGpUs

Similar Articles

Regular expressions that work "everywhere"

Hacker News Top

The article discusses the challenges of regex portability across tools like sed, awk, grep, and Emacs, and provides a subset of regex features that work reliably across these environments.

The true power of regular expressions (2012)

Hacker News Top

This article explains that modern regex engines like PCRE can parse far more than regular languages, debunking the common claim that HTML cannot be parsed with regex.

Readable Regular Expressions for JavaScript/TypeScript, Inspired by Emacs' rx

Lobsters Hottest

This article introduces a small JavaScript/TypeScript DSL inspired by Emacs' rx macro that lets developers write regular expressions as readable trees of named forms instead of opaque strings. It explains the internals (atoms, seqs, alts, quantifiers) and provides a cheat sheet, side-by-side examples, and a gist with the full source.