Multi Commander > Beta Releases
MultiCommander v7.3 BETA
AlanJB:
Hi Ulf.
I am unclear as to what the expressions is doing...
(19[0-9][0-9])|($1) translates as:
Find AND capture ["19" followed by 2 digits] OR [the first match found]
Is that correct?
Ulfhednar:
Hi AJB, the regex finds any 4 digit value starting with 19 (a year in this case).
If that is found the 1st instance is called to be renamed with ()s; 1923 = (1923)
(&The | is from the Rename dialog text entry field. :P :))
Hi Mathias, yep \ is normally used but I can't pass that to the output field.
[& I also discovered that with the width of the rename window there is no horizontal scrolling for loooooong names, vertical scrolling is OK for multiple rename entries over-filling the window whitespace.]
The issue is with MR adding """s to a <space> which is normally OK e.g. _|" ", but with a regex it adds several automatically & I cannot edit it out as it won't let me... ::) ???
AlanJB:
Hi Ulf.
I see! I was translating the whole line as a regular RegEx :) I didn't realise the "|" was part of the MC Rename process (I've never used it).
No wonder I got confused (well, the syntax and my great age) ;)
I'm a Perl RegEx man myself, so the syntax is slightly different anyway. But you would still need to escape the "(" and ")" for any flavour of RegEx.
Have you tried:
...| \($1\)
(just a WAG) ?
Jungle:
The following pattern seems to work (in 7.1)
--- Code: ---(19[0-9][0-9])|" ($1)"
--- End code ---
Ulfhednar:
Hi Jungle - that is what I expected to happen but I got extra " added when I submitted the string to the dialog.
Your solution does show me where I was 'wrong'. Normally a <space> needs to have " ", so I added them, giving me the result in the attached jpg.
However had I not manually typed in the string in the ... form, MR would have given me the format you have that works. I didn't expect that format could work given the restraints of the " "s. Assumed it would try a literal " ($1)" as the name string. :-[ :-\
Hi AJB - you would be right about the escapes but \ will not enter the equation as a character that the rename form allows for output. (Cannot output a regex from a regex, does that ever work in the ancient mists of Perl?)
I guess you were thinking something like (?:what|the|hell) :)
In the case of the MultiRename dialog you will see the format can be only:- regex in|acceptable folder-file name out
MR is a very useful tool for renaming, & I use it quite a bit in my MC toy-box. ;)
So I guess that is panic over! :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version