Tuesday, July 20, 2010

World's most inefficient way to check for primeness (via Reddit)

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

Fire your perl interpreter, feed this function 982451653, and watch your computer die a slow and painful death...

2 comments:

Anonymous said...

WOW! This is super cool Regex :-)

Anonymous said...

Well, strictly speaking, that's not a regular expression a la formal language theory.

Now THAT would've been real neat!