Primality regex. A regular expression that can identify prime numbers. Unsurprisingly, this one comes from the Perl community.
Primality regex. A regular expression that can identify prime numbers. Unsurprisingly, this one comes from the Perl community.
This is from a talk I did many years ago at the Montreal Perl Mongers. Sorry for the formatting; it was marked up from my plaintext notes.
Python port at http://jtauber.com/blog/2007/03/18/python_primalit y_regex
Primality is so last century...
http://perl.abigail.be/Talks/Sudoku/HTML/
Arien - 18th March 2007 13:32 - #