Test, validate and match regular expressions
The famous unary primality test: matches strings of repeated 1s whose count is NOT prime. The first alternative matches zero or one '1' (0 and 1 aren't prime), while the second uses a lazy-captured block of two or more 1s plus a backreference repetition to identify composite lengths. With gm flags it checks each line of unary numbers, so any line that fails to match has a prime count of 1s. A classic demonstration of mathematical computation via backreferences in PCRE.