← Back

January 6, 2014

#1313: Regex Golf

Regex Golf

[[A woman sits at a laptop, leaning back over her chair to address a figure.]]

Regex golf:

Woman: You try to matchone one group but not the other.

M | [TN]|B

matches Star Wars subtitles but not Star Trek.

Figure: Cool.

[[We zoom to just show the woman, looking at her screen.]]

Meta-regex golf:

Woman: So I wrote a program that plays regex golf with arbitrary lists…

Figure: Uh oh…

[[We zoom back out. The figure is facepalming. The woman is typing.]]

Meta-meta-regex golf:

Woman: …but I lost my code, so I’m grepping for files that look like regex golf solvers.

[[We zoom back in.]]

… And beyond:

Woman: Really, this is all

(meta-)*regex golf

.

Figure: Now you have infinite problems.

Woman: No, I had those already.

{{Title text:

bu|[rn]t|[coy]e|[mtg]a|j|iso|n[hl]|[ae]d|lev|sh|[lnd]i|[po]o|ls

matches the last names of elected US presidents but not their opponents.}}