Regex help needed please.

Associate
Joined
17 Nov 2003
Posts
1,911
Location
Gateshead
I've turned my hand to a many, many things development related but regex continues to elude me!!

I need a regex to match filenames with extension where the filename part before the extension ends with a '-'.

Some example filenames...

filename.jpeg
filename-.png <-- MATCH
file name.doc
file name 3.mp4
file name -.dxg <-- MATCH
file.name.mov

NOTE: The filename may contain any valid character including periods.

Many thanks in advance :)
 
Associate
OP
Joined
17 Nov 2003
Posts
1,911
Location
Gateshead
Flippy's suggestion help me out. I needed the pure regex, it's for some software that requires a regex input.
I agree there are many ways to skin a cat (c#, python, JS, etc) but I needed a specific way in this case.

Thanks all! :)
 
Back
Top Bottom