Nick Zadrozny

  • Ask me anything!
  • Post archive
  • RSS feed

A regular expression to check for prime numbers

/^1?$|^(11+?)\1+$/

Probably not the best algorithm to find prime numbers, but it certainly is a clever abuse of regular expressions!