http://www.dzone.com/links/rss/a_regular_expression_to_check_for_prime_numbers.html
Just in case that link ever fails in the future, a regular expression to check for PRIME numbers? This breaks my mind too much.
Regular expressions are extremely powerful: /^1?$|^(11+?)\1+$/ checks if a number is prime or not.
No comments:
Post a Comment