Trim filename

A swapping-ground for Regular Expression syntax

Trim filename

Postby jess » Wed Jun 20, 2018 10:22 pm

I know a bit of coding but don't understand regex at all! I've tried a few things but I'm getting a bit frustrated! :shock:

I have some filenames in thus format:

london-january-bus-outside.jpg
liverpool-docks-bar-water.jpg

I want to strip everything before the last dash, leaving

outside.jpg
water.jpg

etc.

Can anyone provide the code? Please! :D
jess
 
Posts: 2
Joined: Wed Jun 20, 2018 10:15 pm

Re: Trim filename

Postby jess » Thu Jun 21, 2018 12:09 am

I fluked it :D

Code: Select all
match: (.*)-(.*)
replace: \2
jess
 
Posts: 2
Joined: Wed Jun 20, 2018 10:15 pm


Return to Regular Expressions