Trying to delete digits without changing anything else

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

Trying to delete digits without changing anything else

Postby jhsgalaxy » Wed Dec 28, 2016 3:18 am

Hi there,
I am trying to delete only digits appearing after a space using the regex \s\d.
So far BRU does finds what I want it to find.
However, my trouble is what to write into the replace name, I simply want BRU to keep all other characters of the file just as they are, but for some reason, I can't find a solution for that.
Does anybody has an idea?
I.e.:
I have
>>filename series12 2053<<
>>filename series09 20<<
>>filename series17 2053897143<<
and so on
I need to keep >>filename series**<< therefore I used regex "\s\d" to "find" all digits only after a space
Sometimes, the amount of digits at the end of the filename are only 2, sometimes they are 14, sometimes 7 and so on
So I would need an extension to the expression "\s\d" to 'find' all of the digits after the space
And I need whatever I have to write into the field "replace" to keep anything else of the file name; problem here the "filename" may be one word,
but it may also be 2 or 3 or 4 or even more words, therefore "swapping" and then deleting beginning numbers in a second step is no option at all.

Thank you very much in advance and Happy New Year.
JHS
jhsgalaxy
 
Posts: 1
Joined: Wed Dec 28, 2016 2:51 am

Re: Trying to delete digits without changing anything else

Postby therube » Wed Dec 28, 2016 5:06 am

Maybe something like this?

Code: Select all
1:RegEx

Match:  (.*?)\s\d+(\D.*)
Replace:  \1\2
therube
 
Posts: 390
Joined: Mon Jan 18, 2016 6:23 pm

Re: Trying to delete digits without changing anything else

Postby Emerkamp » Wed Dec 28, 2016 9:36 am

Section (5) Remove: is the quickest for just removing digits.

Remove all digits:

Remove (5):
Tick digits

This may leave spaces behind, so double check and take care of them also.
Emerkamp
 
Posts: 111
Joined: Sat Aug 23, 2014 2:35 pm

Re: Trying to delete digits without changing anything else

Postby KenP » Wed Dec 28, 2016 9:54 am

I'm not 100% sure about what you want to do, if you want to delete everything after the series number this will work.
(If you literally want a space after the series number just add a space after "Replace: \1")

RegEx (1)
Match: (.*series\d{2})
Replace: \1


However, if after the digits that you want to delete you have something that you want to keep, such as an episode name, this should work.

RegEx (1)
Match: (.*series\d{2})\s\d*(.*)
Replace: \1\2
KenP
 
Posts: 198
Joined: Sat Jul 30, 2016 11:25 am


Return to BRU Support