Language: C#
Hello, I'm writing an application that uses renaming rules to rename a list of files based on information given by the user. The files may be inconsistently named to begin with, or the filenames may be consistent. The user selects a list of files, and inputs information about the files (for MP3s, they would be Artist, Title, Album, etc). Using a rename rule (example below), the program uses the user-inputted information to rename the files accordingly.
However, if all or some the files are named consistently, I would like to allow the program to 'guess' the file information. That is the problem I'm having. What is the best way to do this?
Sample information
Sample filenames
Kraftwerk-Kraftwerk-01-RuckZuck.mp3 Kraftwerk-Autobahn-01-Autobahn.mp3 Kraftwerk-Computer World-03-Numbers.mp3
Rename Rule
%Artist%-%Album%-%Track%-%Title%.mp3
The program should properly deduce the Artist, Track number, Title, and Album name.
Again, what's the best way to do this? I was thinking regular expressions, but I'm a bit confused.