AAAA, BBBB and CCCC could all be any characters - alphanumeric or symbols.
I have this regular expression for swapping portions of a filename around:
Filename: AAAA - BBBB
Match: ^(.*) - (.*)$
Replace: \2 - \1
Resulting Filename: BBBB - AAAA
However, I have thousands of files and would like to be able to select them all in one go and have this regular expression ONLY affect the ones that are formatted as AAAA - BBBB. Some files are formatted as AAAA - BBBB - CCCC and are still affected by the regular expression despite the use of ^ and $ to mark the start and end. The files with CCCC are affected like this:
Filename: AAAA - BBBB - CCCC
Match: ^(.*) - (.*)$
Replace: \2 - \1
Resulting Filename: CCCC - AAAA - BBBB
How do I get the regular expression to only apply to the filenames formatted as AAAA - BBBB even if some selected files are formatted as AAAA - BBBB - CCCC?