News for hackers. Stuff that matters.
Re:Regular Expression That Checks If a Number Is Prime (2016) by jagtodeath on Sunday December 29, 2019 @06:21PM (#21909349)
A python implementation of is_prime(n):

  return re.compile(r'^1?$|^(11+)\1+$').match('1' * n) is None