Skip to content

Instantly share code, notes, and snippets.

@ryenus
Created April 15, 2012 12:46
Show Gist options
  • Save ryenus/2392592 to your computer and use it in GitHub Desktop.
Save ryenus/2392592 to your computer and use it in GitHub Desktop.
A regular expression to check for prime numbers
# see http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/
/^1?$|^(11+?)\1+$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment