Re: RegEx Rename fail in 4.3
Posted: 2019 Nov 27, 16:40
must be because I don't think I can change anything more about it
xplorer² Deskrule and other programs
https://forum.zabkat.com/
I see where the extra underscores are coming from... it's because the \s are being replaced by _ because the rename routine sees them as invalidlongfellow wrote: ↑2019 Nov 25, 15:12 Unfortunately case conversion is still a problem.
filename = camelCaseToSnakeCase.txt
regexp = (.+?)([A-Z])
replace with = $1_\L$2\E
expected result = camel_case_to_snake_case.txt
result = camel__LC_Ease__LT_Eo__LS_Enake__LC_Ease.txt
I'm following the instructions here: <http://www.regexlab.com/en/deelx/syntax/bas_esc.htm>
You can see that the correct characters for conversion are being selected, they're just not being converted. Not sure why there's an extra underscore before the "L".If begins with \L, ends with \E, it will quote (disable) pattern metacharacters from \L till \E, and all uppercase alphas between them will be turned into lowercase."
Same problem with uppercase:
filename = snake_case_to_camel_case.txt
regexp = (.*?)_([a-zA-Z])
replace with = $1\U$2\E
expected result = snakeCaseToCamelCase.txt
result = snake_Uc_Ease_Ut_Eo_Uc_Eamel_Uc_Ease.txt
The \U and \L tokens work fine elsewhere, I can only speculate that it's some peculiarity of the Deelx engine that they don't work here. Perhaps there is some arcane syntax usage I am missing? Sad, as capitalization/decapitalization is a handy feature in a renamer.
I can confirm this behavior in the DEELx Regex Match Tracer and in the mass renaming tool.hajubu wrote: ↑2019 Dec 01, 22:26 It shows however that the "Quoted Characters" works on "Matching-Mode/Input" and not for changing the Output chars ($1,$2,$+)
The main purpose is :: metacharacters can be handled like the common characters
i.e. \Q(a+b)*3\E :: matches "(a+b)*3".
and without quoting :: \(a\+b\)\*3 :: Without \Q...\E, we need to escape each special character.