Jun-24-2018, 08:24 AM
Hi,
Could you help me out a bit? I'd like to remove those colored characters out of a bunch of files like these:
a = 'Python Tutorial for Beginners 1 - Install and Setup for Mac and Windows-YYXdXT2l-Gg.mkv'
b = 'Python Tutorial for Beginners 2 - Strings - Working with Textual Data-k9TUPpGqYTo.mkv'
I'm here so far:
always starts with a - character, followed by a letter, until a . which is the file extension.
Thanks
Could you help me out a bit? I'd like to remove those colored characters out of a bunch of files like these:
a = 'Python Tutorial for Beginners 1 - Install and Setup for Mac and Windows-YYXdXT2l-Gg.mkv'
b = 'Python Tutorial for Beginners 2 - Strings - Working with Textual Data-k9TUPpGqYTo.mkv'
I'm here so far:
def replacer(filename): n = re.findall('-[^a-zA-Z0-9]', filename) print(n)The regex would be like this
always starts with a - character, followed by a letter, until a . which is the file extension.
Thanks