Keep last bit of filename with extension

A swapping-ground for Regular Expression syntax

Keep last bit of filename with extension

Postby mevans » Wed Oct 11, 2017 9:53 am

Hi all,

I'm a new user and struggling to get predictable results with this requirement to keep the last x number of characters (and the file extension).

I need to remove all of the charactors and symbols ect. before "abc_abc_abc.pdf" (where abc could be any text of number)

any help with this would be much appreciated!

many thanks :D

mevans
mevans
 
Posts: 2
Joined: Wed Oct 11, 2017 9:48 am

Re: Keep last bit of filename with extension

Postby KenP » Wed Oct 11, 2017 10:01 am

Try this.

RegEx (1)
Match: .*(.{3}_.{3}_.{3})$
Replace: \1
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Keep last bit of filename with extension

Postby mevans » Wed Oct 11, 2017 10:13 am

many thanks for the speed reply. that worked a treat!
mevans
 
Posts: 2
Joined: Wed Oct 11, 2017 9:48 am


Return to Regular Expressions


cron