This regular expression (in Python) detects strings of 1's whose length is composite. So strings of all 1's that do not match are prime in length.
r = re.compile(r"^(11+)(\1+)$")This regular expression (in Python) detects strings of 1's whose length is composite. So strings of all 1's that do not match are prime in length.
r = re.compile(r"^(11+)(\1+)$")