Regex strings losing order

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

Regex strings losing order

Postby bigi » Tue Nov 04, 2025 1:22 am

I've been happily using a mixture of regex, find/replace and remove functions for thousands of files over the last couple of months; but tonight (after a windows 11 update), the regex is going completely haywire! it's matching one group, but seems to be using the replace section from another - for example, i'm suddenly getting the last ")" in a name changed to "[)]" and getting extra spaces round "-"; the best one is "12inch" being changed to "C'est".....!

I've cleared and reinstalled BRU and manually readded the regex again, but it's exactly the same. our AI friend suggested that the .NET/PCRE engine in windows has been changed in the current windows 11 release and thats why it may have broken - and to use the built in dll with BRU by enabling a legacy dll mode - but it's not in 4.1 from what i can see.

Has anyone else seen this problem? it's doing my head in! spent ages getting this working perfectly, and now it's gone to pot again :-(
bigi
 
Posts: 26
Joined: Fri Nov 22, 2024 12:10 am

Re: Regex strings losing order

Postby Admin » Tue Nov 04, 2025 10:28 am

Hi, BRU does not depend or use .NET nor external Windows DLLs for Regex. Would you be able to send your file (.bru) and issue description to support via email?
thanks
Admin
Site Admin
 
Posts: 3118
Joined: Tue Mar 08, 2005 8:39 pm

Re: Regex strings losing order

Postby bigi » Wed Nov 05, 2025 12:32 am

Hello

As usual, AI gets it wrong again :)

I've just done a complete clean and downloaded 4.1 and installed it again and cut and pasted my regex etc over, and it's still screwed up order.

Will send through an email now
bigi
 
Posts: 26
Joined: Fri Nov 22, 2024 12:10 am

Re: Regex strings losing order

Postby bigi » Wed Nov 05, 2025 1:37 am

Have sent an email through to support@bulkrename address with a screenshot of the issues and curent bru.

I've just tried again, this time manually adding each entry into the regex. the first few seemed to work fine, but the moment it hit the below, it started going wrong:
(?i)^Various\s+Artists+\ ?-\ ? >>>>>> <null>
(?i)^Various\s++\ ?-\ ? >>>>>> <null>

I removed them and continued to add entries - but it then got caught up on another set:
(?i)12('{1,2}|"|inch(?:es)?)
(?i)10('{1,2}|"|inch(?:es)?)
(?i)7('{1,2}|"|inch(?:es)?)
(?i)3('{1,2}|"|inch(?:es)?)

Moving these to the top stopped the issue with them using the previous match replace field; but then other matches are still having problems:
?i)(?<![\(\[])\bdon'?t\b(?![\)\]]) >> is being matched the the previous regex match replace field (Basil O'Glue).

I'm using 170 replace fields and 58 regex fields; i know there was a reg key issue previously with data (hence why i moved to regex and replace instead of all replace matches), but it's not losing any parameters this time - and i've tried with just the regex and nothing in the replace list at all and it still happens?

*FYI the fields abopve referenced are all the ones that are in the bru file I sent through to the support email!*
bigi
 
Posts: 26
Joined: Fri Nov 22, 2024 12:10 am

Re: Regex strings losing order

Postby bigi » Wed Nov 05, 2025 11:55 pm

just a quick update on this - i've spent about 3 hours tonight trying to get anything working properly - it seems for some reason the regex is completely broken - even with a clean install and using a win10 machine and different filenames!

I've removed all the parameters with case sensitivty in them and just concentrated on some basic processing - year formatting for example. but this is not working properly either - it seems that the regex just doesn't work the way it was doing any more! for example, in the regex I have 5 lines to handle year fields and strip any brackets and padding and enclose in parenthesis. all of a sudden, it's stopped handling dates that are preceeded by ...] <year> - I've tried all sorts of combinations to fix it and it just doesn't want to behave properly - it is ignoring () around the matched field in replace, and when i add double (()) i see one set - but AFTER a space and the unenclosed year! the only updates on my machine that have happened since 30/11 are 3 win 11 updates:

PowerShell v7.5.4 (x64)
Preview Update (KB5067036) (26200.7019)
.NET Framework Preview Update (KB5067931)

btw - i have sent another email to support - for some reason, the reason you didn't get the .bru file the first time was because the ios Yahoo mail app is stripping .bru file attachments! you should now have it.... :D
bigi
 
Posts: 26
Joined: Fri Nov 22, 2024 12:10 am

Re: Regex strings losing order

Postby bigi » Sat Nov 08, 2025 12:23 am

I've been playing around with this, and i'm now resorted to using the standalone non installing package to check things - this still has the same issues.

I've foudn the problem - NOT windows but a typo in a single regex entry!

(?i)([\(])(Deluxe\s+Edition([\(]) >>> (Deluxe Edition)

Spot the missing closing parenthesis.....

I added the missing ) in and surprise surprise, things started working again! I can only think that when my dog has decided to lie down on the desk he's managed to deleet a random character on me and i haven't noticed!

It should, of course read:
(?i)([\(])(Deluxe\s+Edition)([\(]) >>> (Deluxe Edition) - i changed the regex to this to enable me to strip off any parenthesis if they exist, BEFORE adding new ones as i was getting some double brackets.

I can now reinstall the windows updates and enable them again.....!

Never trust an animal near your regex...... :D :D
bigi
 
Posts: 26
Joined: Fri Nov 22, 2024 12:10 am

Re: Regex strings losing order

Postby Admin » Sun Nov 09, 2025 5:11 am

Never trust an animal near your regex......
:D :D
Is this solved now?
Admin
Site Admin
 
Posts: 3118
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support