Page 1 of 1

Remove everthing before last underscore

PostPosted: Thu Nov 30, 2017 3:34 pm
by Alphastacker
I have seen similar question but couldnt find the exact answer.

I need to rename something like this: 1234_2017-06-30_Smith_Smith Group Reports.pdf

to this Smith Group Reports.pdf

So remove everything before the last underscore.

Any help would be appreciated.

Re: Remove everthing before last underscore

PostPosted: Thu Nov 30, 2017 3:59 pm
by KenP
I'm unable to test this in BRU at the moment, but it should work.

RegEx (1)
Match: .*_(.*)$
Replace: \1

Re: Remove everthing before last underscore

PostPosted: Thu Nov 30, 2017 4:10 pm
by Alphastacker
Worked perfectly. Thanks!

Is there a good RegEx cheat sheet that explains how to set these things up in BRU?

Re: Remove everthing before last underscore

PostPosted: Thu Nov 30, 2017 9:39 pm
by KenP
Alphastacker wrote:Worked perfectly. Thanks!

Is there a good RegEx cheat sheet that explains how to set these things up in BRU?

Have a read of the Getting help with Regular Expressions page.