You are not logged in.
Pages: 1
Compare of ReNamer and PowerRename:
Test of RegExr.com:
Last edited by diditi2020 (2020-05-24 08:37)
Offline
You are trying to use an expression "(\W+\.)?([\w\.]+)(.*)" with a replacement "$2" to convert something like "汉语.test.txt" to "test.txt". This won't do anything, if you consider that "\w" stands for a word character in any language and "\W" is the reverse of it, i.e. not a word character in any language.
ReNamer treats all Unicode word characters equally. You need to replace "\W" with "\w" in your example, so the expression becomes "(\w+\.)?([\w\.]+)(.*)".
Your other sources, PowerRename and RegExr.com, treat "\w" as alphanumeric & underscore in Latin only, equivalent to "[A-Za-z0-9_]".
Offline
ReNamer treats all Unicode word characters equally.
Now, there is a new probrem about unicode:
But real strange is, I only used $2, and output this:
Last edited by diditi2020 (2020-05-24 12:23)
Offline
Screenshots are great, but please also post your examples and rules configuration in plain text, to help us investigate.
You can use the "Export to Clipboard" option in the context menu of the rules table.
Offline
Screenshots are great, but please also post your examples and rules configuration in plain text, to help us investigate.
You can use the "Export to Clipboard" option in the context menu of the rules table.
ReNamer 7.2.0.1 beta
replace: $2
([\u4e00-\u9fa5]+)([A-Z0-9]+)
測試TEST → 測試T
測試1234 → 測試4
TEST1234 → 4
([^\x00-\xff]+)([A-Z0-9]+)
測試TEST → T
測試1234 → 4
TEST1234 → 4
------------------------
replace: $1_$2
([\u4e00-\u9fa5]+)([A-Z0-9]+)
測試TEST → 測試TES_T
測試1234 → 測試123_4
TEST1234 → TEST123_4
Last edited by diditi2020 (2020-05-24 17:45)
Offline
The syntax used by the Regular Expressions engine in ReNamer is slightly different to the one you assume.
The hex based character codes can be entered as "\xnn" or "\x{nnnn}".
See the reference for more information:
https://www.den4b.com/wiki/ReNamer:Regular_Expressions
If we look at your original expression, to be replaced by "$2":
([\u4e00-\u9fa5]+)([A-Z0-9]+)
It should be modified as follows:
([\x{4e00}-\x{9fa5}]+)([A-Z0-9]+)
Input:
測試TEST
測試1234
TEST1234
Output:
TEST
1234
TEST1234
Offline
Pages: 1