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
This will do the trick
(.*)\.
Regex Demo
The first captured group contains the name. You can access it as $1 or \1 as per your language
$1
\1