Renamed files renamed incorrectly - Regex: & Name Segment

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Renamed files renamed incorrectly - Regex: & Name Segment

Postby therube » Thu Jan 09, 2025 4:40 pm

Renamed files renamed incorrectly - in some circumstances.

Related to RegEx: & Name Segment ?


BRU 4004
Win7 x64, BRU x86

1:RegEx, should not affect anything as nothing is matched
- yet it does
3:Replace, does not affect anything
4: Case, should change case
*: Name Segment: has <sp><sp> for both From: & To:


with that, oddity?


^name, shows it will end up as "nameName"
Hi There, are properly capitalized
you swine<sp><sp>name1, incorrectly gets capitalized & the source dup'd

& it looks like it is the 1:RegEx causing this
(cause if you uncheck 1:RegEx, the issue goes away)
(wonder if V2 plays in? didn't look at that?)


Image
therube
 
Posts: 1407
Joined: Mon Jan 18, 2016 6:23 pm

Re: Renamed files renamed incorrectly - Regex: & Name Segment

Postby Admin » Fri Jan 10, 2025 12:12 am

Hi, I will double-check this. Could you save all the settings you are using to a .bru file and then copy and paste the .bru file here (with a text editor), so I know I will be using exactly the same criteria. Which file names have an issue? thank you very much 8)
Admin
Site Admin
 
Posts: 2733
Joined: Tue Mar 08, 2005 8:39 pm

BUG: V2 Regex(1) with Name Segment

Postby Luuk » Fri Jan 10, 2025 5:47 am

If it helps the programmers for troubleshooting...
With 'v2', anything inside the "Match" (except .*) doubles everything outside of Name-Segments range.
And it doesnt seem to matter whether Name-Segment uses positions-numbers or typed-characters.

So if From==x and To==y matches a range, then even a non-matching 'v2' renames like...
12xy34 --------> 1212xy3434
12xaay34 -----> 1212xaay3434
123xz456 -----> (not renamed, no range matched)

It seems like Name-Segment reserves "outside-of-range" to be added-in after RegEx(1) processing?
But then somehow, those "outside-of-range" characters are getting added back double instead??

Probably the reason .* works, is because it really matching the whole-filename, even outside of the range.
So then, when "outside-of-range" gets added back after RegEx(1), the New-Name happens to be the same??


Without 'v2', the difference is that any non-matching "Match" will never modify the new-name.
But even with matching-ones, Name-Segment can still double its "outside-of-its range" afterwards...
Example using above range, Match==^(..)xy(..)$ and Replace==\1--\2
12xy34 --------> 1212--3434
12xaay34 -----> (not renamed, since xy doesnt match)
123xz456 -----> (not renamed, since no range matched by Name-Segment)

Thanks again for all the updates lately!
Luuk
 
Posts: 786
Joined: Fri Feb 21, 2020 10:58 pm

Re: Renamed files renamed incorrectly - Regex: & Name Segment

Postby Admin » Fri Jan 10, 2025 7:25 am

Thanks guys, I see it now... when File Segment is active, the Regex (1) does not seem to work 100% properly. We will investigate! thank you for reporting this,
Admin
Site Admin
 
Posts: 2733
Joined: Tue Mar 08, 2005 8:39 pm

Re: Renamed files renamed incorrectly - Regex: & Name Segment

Postby therube » Mon Jan 13, 2025 6:05 pm

(Suspect you don't need it. Anyhow...)

Code: Select all
[General]
Path=""
[Regular Expressions]
Match="(.*?)\s(\d\d\d\d)$"
Replace="\1 (\2)"
Include Extension=0
Simple=0
v2=1
[Filename]
Mode=0
Fixed=""
[Replacements]
Replace=" - ("
With=" ("
Match Case=0
First Only=0
[Case]
Change=3
Exceptions="xv"
[Removals]
First N="0"
Last N="0"
From="0"
To="0"
Chars=""
Words=""
All Digits=0
All Chars=0
All Symbols=0
All High=0
Trim=0
Double Space=0
Accents=0
Crop Mode=0
Crop Marker=""
Lead Dots=0
[MoveCopy]
Source=0
Number="1"
Range="0"
Target=0
Target Pos="1"
Separator=""
[Additions]
Prefix=""
Text=""
Text Pos="0"
Suffix=""
WordSpace=0
[Auto Date]
Mode=0
Type=0
Format=0
Separator=""
Segments=""
Custom=""
Century=0
Offset="0"
[Folder Name]
Mode=0
Separator=""
Levels="1"
[Auto-Number]
Mode=0
Start="1"
Insert="0"
Increment="1"
Pad="0"
Break="0"
Separator=""
Type=8
Case=0
Break Folder=0
[Extension]
Mode=0
Fixed=""
[Selections]
Filter="*"
Filter Match Case=0
Filter Use Regex=0
Files=1
Folders=1
Subfolders=0
Hidden=0
Subfolders Level=0
Min Name Length="0"
Min Path Length="0"
Max Name Length="0"
Max Path Length="0"
Condition=""
[New Location]
Path=""
Copy Not Move=1
[Name Segment]
From="0"
To="0"
[Criteria]
RegEx=1
File=1
Replace=1
Case=1
Removals=1
MoveCopy=1
Additions=1
AutoDate=1
Folder=1
AutoNumber=1
Extension=1
NameSegment=1
Change Renaming Criteria Order=0
Change Timestamps=0
Change Attributes=0
Javascript Renaming=0
Character Translation=0
[Renaming Criteria Order]
Criteria Order=""
Name Segment Order=0
[Preferences]
Change Created Timestamp=0
Change Modified Timestamp=0
Change Accessed Timestamp=0
Created Timestamp=0
Modified Timestamp=0
Accessed Timestamp=0
Created Timestamp Delta=0
Modified Timestamp Delta=0
Accessed Timestamp Delta=0
Created Timestamp Delta Negative=0
Modified Timestamp Delta Negative=0
Accessed Timestamp Delta Negative=0
DateTaken Change To=0
Change Attributes=0
therube
 
Posts: 1407
Joined: Mon Jan 18, 2016 6:23 pm

Re: Renamed files renamed incorrectly - Regex: & Name Segment

Postby Admin » Wed Jan 15, 2025 1:28 pm

Thank you! We found the issue, it will be fixed in the upcoming update!
Admin
Site Admin
 
Posts: 2733
Joined: Tue Mar 08, 2005 8:39 pm

Re: Renamed files renamed incorrectly - Regex: & Name Segment

Postby Admin » Tue Jan 21, 2025 7:34 am

Hi, this has been fixed in version 4.0.0.5. Thanks for the heads-up! 8)
Admin
Site Admin
 
Posts: 2733
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support