I have a file naming pattern such as
this is a 9876 file name .1234.ext
OR
thisisa9876filename .4321.ext
I can return a match easily enough for .1234.ext by using
/(\.\d{4}\.ext)$/
What I want to do is find a match if it is not that format. e.g.
thisisa9876filename.123.ext
OR
this is a 9876 file name.txe
So effectively if it doesn't match that pattern I want to return a match.
I can't seem to work out any solution to this. Any help would be greatly appreciated.