fork download
  1. import re
  2.  
  3. pattern = r"^[a-f\d]+(?:-{1,2}>[a-f\d]+)+$"
  4. s = ("0912adbd->12d1829-->218990d\n"
  5. "ab2c8d-->82a921->193acd7\n"
  6. "test")
  7. print(re.findall(pattern, s, re.I | re.M))
Success #stdin #stdout 0.03s 9860KB
stdin
Standard input is empty
stdout
['0912adbd->12d1829-->218990d', 'ab2c8d-->82a921->193acd7']