Revision: 6786
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 14, 2008 11:02 by banzaiman
Initial Code
print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/
Initial URL
Initial Description
By the legendary abigail. Fails to match if and only if it is matched against a prime number of 1's. That is, '11' fails, but '1111' does not. I once heard him talk why this works, but I forgot most of it.
Initial Title
Prime number tester
Initial Tags
regex
Initial Language
Regular Expression