[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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