Say we have a list of files like
test(1) -> test
test2(1) -> test2
test3(note to self) (6) -> test3(note to self)
We can make no assumptions about the rest of the string outside of the fact that there will be a set of parentheses at the end with something inside. So that means there might be parentheses before the last set of parentheses which should not be touched. only the last parentheses.
How to accomplish this with re
python module?