fork download
  1. import re
  2. regex = r"\d(?=(\d{3}))"
  3. test_str = "123456789"
  4. matches = re.finditer(regex, test_str)
  5.  
  6. for match in matches:
  7. print(match.group()+match.group(1));
  8.  
Success #stdin #stdout 0.02s 27792KB
stdin
Standard input is empty
stdout
1234
2345
3456
4567
5678
6789