Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Python

r"
^1?$|^(11+?)\1+$
"

Description

Given a number N represented by its unary form N(1), when RegEx doesn't match N(1), N is prime

Submitted by LexDias - 9 years ago