fork download
  1. import re
  2. '''
  3. testString = "0.0022271714922048997772828507795100222717149220489977728285077951002227171492204899777282850779510022"
  4. print(re.search(r"(\d\/?\d)(\d+?)(?=\1)", testString).group(0))
  5. '''
  6.  
  7. a = ["0.0022271714922048997772828507795100222717149220489977728285077951002227171492204899777282850779510022","0.714285714285714285714285714285714285714285","0.111111111111111111111111111111111111111111","0.166666666666666666666666666666666666666666"]
  8. for i in a:
  9. print(re.search(r"(\d\d)(\d+?)(?=\1)", i).group(0))
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
00222717149220489977728285077951
714285
111
666