[Omaha.pm] Check For Primes Using Perl & Regex

Travis McArthur travis at travisbsd.org
Tue Sep 25 22:53:07 PDT 2007


http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/

I found this page while randomly surfing the net this evening, I found 
it quite amusing and figured some people here might too.

Using regular expressions to check for the primality of a number seemed 
very novel to me, and it's in Perl as well (though they give one example 
in Ruby too).

Very cool stuff (and a testament to the power of Perl's regular 
expressions engine).

Best Regards,
Travis


More information about the Omaha-pm mailing list