import retext = r"./[\folder]/this-is-a.test/fi^le.cxx.LAST[]^\/-.h"text = re.sub(r'([][^\\./-])(?=.*\1)', '', text, flags=re.S)print(text)
Standard input is empty
folderthisisatestfilecxxLAST[]^\/-.h
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!