Look for a string containing (ab-cd)

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

Look for a string containing (ab-cd)

Postby torredipisa » Mon Jan 16, 2023 6:59 pm

Hello
I kindly need your help for this task:
Simply I want to retrieve all the files which contain a string-text of this type: (ab-cd)
where a,b,c,d, can be any char, "(", ")" and "-" are fixed instead.
Thank you for yr assistance.
Fabio
torredipisa
 
Posts: 12
Joined: Thu Jul 28, 2022 11:28 am

Re: Look for a string containing (ab-cd)

Postby therube » Mon Jan 16, 2023 9:10 pm

If you're looking to find files, filtered, based on what you described:

12:Filter, RegEx (checkmark)
Code: Select all
Mask: \(..-..\)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Look for a string containing (ab-cd)

Postby torredipisa » Tue Jan 17, 2023 10:10 am

Thank You
And if (after that) I would want to replace the "-" with "+"?
Regards
FAbio
torredipisa
 
Posts: 12
Joined: Thu Jul 28, 2022 11:28 am

Re: Look for a string containing (ab-cd)

Postby Admin » Fri Jan 20, 2023 4:43 am

Examples of file name from -> to please? thanks
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: Look for a string containing (ab-cd)

Postby torredipisa » Sat Jan 21, 2023 4:50 pm

Well I have retrieved all the files containing a string like (ab-cd).
Now I want to change - into + --> (ab+cd).
torredipisa
 
Posts: 12
Joined: Thu Jul 28, 2022 11:28 am

Re: Look for a string containing (ab-cd)

Postby Admin » Sun Jan 22, 2023 3:00 am

Use Replace (3), replace (ab-cd) with (ab+cd)
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: Look for a string containing (ab-cd)

Postby torredipisa » Sun Jan 22, 2023 4:48 pm

Maybe I made a bit of confusion.....
My first aim was to retrieve the files whose name contained a text-string type: (xx-xx) where (,),- were fixed chars and x can be any char.
My further question is: how can I change the char "-" into "+" for every (xx-xx) ?
Thank You for yr help
torredipisa
 
Posts: 12
Joined: Thu Jul 28, 2022 11:28 am

Re: Look for a string containing (ab-cd)

Postby therube » Mon Jan 23, 2023 6:11 pm

1:Regex
Code: Select all
Match:  (.*?)(\(..)-(..\))(.*)
Replace:  \1\2+\3\4

Match anything, non-greedy
Match ( followed by 2 chars
(followed by -)
Match 2 chars followed by )
Match everything else
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm


Return to BRU Support


cron