Just want to match every character up to but not including the last period
dog.jpg -> dog abc123.jpg.jpg -> abc123.jpg
I have tried
Use lookahead to assert the last dot character:
.*(?=\.)
Live demo.