I have these types of strings:
aabbcc-12-00001-g001-1024.png
ddeeffgg-1-50001-i001-500.jpg
ddeeffgg-1-50001-i001.jpg
I would like to extract the file name without its size, which will always be -xxxeither -xxxxbefore the file extension.
For example, for three lines, I would like to match:
aabbcc-12-00001-g001.png
ddeeffgg-1-50001-i001.jpg
ddeeffgg-1-50001-i001.jpg
My idea was to mark the size first and then use preg_replace with PHP, but not sure how to fit the size as soon as I try:
-\d{3,4}\.[a-z]{3}
But this corresponds to -550.png or -1024.jpg, etc.
source
share