fork(1) download
  1. import re
  2.  
  3. texto = 'lorem ipsum [Ticket: 20021501280806] blablabla [Ticket: 123456789] etc [Ticket: 987654] xyz.'
  4. r = re.compile(r'\[Ticket: (\d+)\]')
  5. matches = r.findall(texto)
  6.  
  7. print(matches) # ['20021501280806', '123456789', '987654']
Success #stdin #stdout 0.02s 9456KB
stdin
Standard input is empty
stdout
['20021501280806', '123456789', '987654']