fork download
  1. import re
  2. from io import StringIO
  3.  
  4. field_pattern = re.compile(r'(?<=(?<!\S)\{)[^}]*(?=\}(?!\S))|(?<!\S)(?!\{)\S+(?!\S)')
  5. file = StringIO('''\
  6. commit file before after
  7. {./SonarSource-sonarqube/592397657f44ebb8869159e86087fa62f2c64dd0} {QGChangeEventListenersImplTest.java} 0.2554725331856924 0.25835876057253165
  8. {./SonarSource-sonarqube/51ae2098d531a72c7a7136a4da1063fe05a2bc0e} {SearchAction.java} 0.6027389261871576 0.5584944983323415
  9. {./SonarSource-sonarqube/22600d84f370f18b3050e2e06eec9d9975117487} {IssueQueryTest.java} 0.2875728372794886 0.2879662721728285
  10. ''')
  11. next(file)
  12. for fields in map(field_pattern.findall, file):
  13. print(fields)
Success #stdin #stdout 0.03s 9752KB
stdin
Standard input is empty
stdout
['./SonarSource-sonarqube/592397657f44ebb8869159e86087fa62f2c64dd0', 'QGChangeEventListenersImplTest.java', '0.2554725331856924', '0.25835876057253165']
['./SonarSource-sonarqube/51ae2098d531a72c7a7136a4da1063fe05a2bc0e', 'SearchAction.java', '0.6027389261871576', '0.5584944983323415']
['./SonarSource-sonarqube/22600d84f370f18b3050e2e06eec9d9975117487', 'IssueQueryTest.java', '0.2875728372794886', '0.2879662721728285']