A regular expression to check for prime numbers (2007)
Technically not a <i>regular</i> expression, as (intuitively) the backreference has to “count” the number of 1’s that were matched. Regular expressions are equivalent to finite state machines, which cannot count arbitrarily high (any state machine that can count arbitrarily high needs an infinite number of states, since there are infinite natural numbers).<p>The 2022 discussion has a more formal proof using the pumping lemma.