fork download
  1. import re
  2. regex = r"\\{2,}"
  3. test_str = r"%Software\\Policies\\\\Microsoft\\Windows\\Safer\\CodeIdentifiers\\0\\Hashes\\"
  4.  
  5.  
  6. subst = r"\\"
  7. result = re.sub(regex, subst, test_str,0)
  8.  
  9. if result:
  10. print (result)# your code goes here
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
%Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Hashes\