fork download
  1. import re
  2. data = '71234567 6-1234567 7-123-4567 61-23-45-67 7-1-2-3-4-5-6-7'
  3. print([x.replace('-', '') for x in re.findall(r'\b[67](?:-?\d){7}\b', data)])
Success #stdin #stdout 0.02s 9692KB
stdin
Standard input is empty
stdout
['71234567', '61234567', '71234567', '61234567', '71234567']