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

the above regular expression could be used to check a number is prime or not! is it amazing? like a magic!

but we know there is no magic in CS.. well, this link has a great explanation.

amazing!