Pattern/RegEx in New Case method is always case insensitive

Advanced Renamer forum
#1 : 10/04-21 23:23
Gedof
Gedof
Posts: 1
I was trying to play around with the case of some file names and realized that the "Pattern" field in "New Case" seems to be case insensitive. This is a made up example of what I was trying to do:

"dreams of ashes - TO THE END"

[Set upper case first letter in every word]
"Dreams Of Ashes - TO THE END"

[Set pattern to lower case (RegEx): " [A-Z][a-z] "]
Expected: "Dreams of Ashes - TO THE END"
Result: "Dreams of Ashes - to THE END"

This is probably not the best way to solve this problem, but it should work for the names that I had.

After that, I tried other things with the pattern, even without RegEx, and it's still case insensitive (if I just put "a" or "A" it will match the same thing either way).

There should probably be an option for case sensitive like there is in "Replace". Luckily I don't have many cases where this would be a problem, I can just rename the few wrong ones manually.


10/04-21 23:23 - edited 10/04-21 23:24
#2 : 11/04-21 00:28
David Lee
David Lee
Posts: 678
Use a Replace method for the second step...

Text to be replaced: ( [A-Z])([a-z] )
Replace with: \L1\2
Case sensitive
Use regular expressions

See www.regular-expressions.info/refreplacecase.html

Alternatively you could use a positive lookahead...

Text to be replaced: ( [A-Z])(?=([a-z] ))
Replace with: \L1
Case sensitive
Use regular expressions

See www.regular-expressions.info/lookaround.html

(But note that lookbehind is not available in PCRE regex as used by ARen. However you can use \K as a workaround - see www.regular-expressions.info/keep.html)


11/04-21 00:28 - edited 11/04-21 00:38