Test, validate and match regular expressions
The famous 'prime number test' regex operating on unary representation. It matches strings of '1' characters whose length is NOT prime: the first alternative matches empty string or a single '1' (0 and 1 aren't prime), while the second matches any composite count by finding a repeated group of two or more 1's using lazy matching and a backreference. To test if a number n is prime, convert it to n consecutive '1' characters and check that this regex does NOT match. A classic example of computational power hidden in regex backreferences.