What would I have to enter in the "Old Name" field to ensure that all name components are found and deleted according to the pattern ~20200116-09-[minute-second], regardless of the value of the [minute-second] part?
An asterisk or multiple question marks don't seem to work (please bear with my Regular Expression ignorance) :o
Bear with me -- I have another unexpected case where I have to rename some 1000 files having a similar filename pattern, where the datestamp has to be removed from the filenames.
The files look like this again:
Example: BlahBlah~20200116-200937.zip
Pattern: [Filename]~[yyyymmdd-HHMMSS].[extension]
The following simple regex seems to catch all files, and remove the complete part after and including the ~Tilde, while keeping the file extension:
Since I probably will need this method (deleting a suffix starting with a certain character string) in the file name) even more often in the future, would you (or some other reader) mind briefly explaining the syntax of ^(.*)~.* to me?
^ means anchor to the start of the string.
.* means match any number of characters. If it's in () it defines a capture group that can be used in the replacement string (e.g. \1 refers to the first capture group)
~ is a literal character that it's searching for.
So what it means is, starting from the start of the string, capture all characters up until the first ~ character.
Then I'd use this ^(.*)-(2019-11-.* for the search string, right?
The parenthesis needs to be escaped. The leading ^ is not needed in RegEx Mode. So you would use (.*)-\(2019-11-.*.
Does this have something to do with the file extension?
No, the option Ignore extension is checked. In RegEx Mode the string needs to represent the entire filename. That's the main difference to RegEx+F&R.
Have a look at the regex explanations in the Opus help. Although it claims to be just an introduction it is very comprehensive and covers a lot of ground. You'll get good mileage from it.
In this case, for the original task (remove filename date suffix starting with ~Tilde, like blahblah~20200116-093959.zip), already this syntax fully does it:
Like in your question before and in my first posting. There I didn't remove the ^ because it's just a cosmetic thing and I didn't want to cause confusion.