import re testString = "0.714285714285714285714285714285714285714285"print(re.search(r"(\d)(\d+?)(?=\1)", testString).group(0))
Standard input is empty
714285
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!