import rerx = r'(?=(11?))\1(?!3)'s = '113'm = re.match(rx, s)if m: print("Valid")else: print("Invalid")
Standard input is empty
Invalid
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!