import re
text = "/BENEF/FORNITURA GAS FEB-20 CIG Z9F               27D2198 01762-0000031"
pattern = r'cig[\s:.]*(\S(?:\s*\S){9})(?!\S)'
matches = re.finditer(pattern, text, re.I)
for match in matches:
  print(re.sub(r'\s+', '', match.group(1)), ' found at ', match.span(1))
