fork download
  1. import re
  2. text = r"./[\folder]/this-is-a.test/fi^le.cxx.LAST[]^\/-.h"
  3. text = re.sub(r'([][^\\./-])(?=.*\1)', '', text, flags=re.S)
  4. print(text)
Success #stdin #stdout 0.02s 9620KB
stdin
Standard input is empty
stdout
folderthisisatestfilecxxLAST[]^\/-.h