fork download
  1. import re
  2. text = """garbage
  3. moregarbaged89849843
  4. MDeduri09ri44830
  5. Some short sentence
  6. Whatever ... key: d11001bfa937eee2f84f55a11b207356 (KID=01002d737832455680cffbadf1092baf)
  7. Whatever2 ... key: a0ee2d0f8272355f750c5434db85291a (KID=0101bfa0ab9641a0b863ef76519a48d3)
  8. Whatever3 ... key: fe216ba17e5af807ce5af8e43cf3c031 (KID=0102900a2bc54111833631ea7bb855ed)
  9. 77EB0A2C7C42EDC27A3D26E72A02BB29:01002d737832455680cffbadf1092baf status 'garbage'
  10. blah blah:0101bfa0ab9641a0b863ef76519a48d3 has status 'usable'
  11. 77EB0A2C7C42EDC27A3D26E72A02BB29:blah blah"""
  12. filteredkids = re.findall(r'KID=\w{30,}', text)
  13. filteredkeys = re.findall(r'key: \w{30,}', text)
  14. print( filteredkids )
  15. print( filteredkeys )
Success #stdin #stdout 0.03s 9632KB
stdin
Standard input is empty
stdout
['KID=01002d737832455680cffbadf1092baf', 'KID=0101bfa0ab9641a0b863ef76519a48d3', 'KID=0102900a2bc54111833631ea7bb855ed']
['key: d11001bfa937eee2f84f55a11b207356', 'key: a0ee2d0f8272355f750c5434db85291a', 'key: fe216ba17e5af807ce5af8e43cf3c031']