/^1?$|^(11+?)\1+$/ November 19, 2009 / Kyle Sun / 0 Comments 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!