Basically what I want to do is replace a filename so that
whatever-[xxx]-[xxx].[xxx]
becomes whatever-150-150.[xxx]
so if I have:
aisuiuhviu123ounsciun-174-345.JPG
becomes aisuiuhviu123ounsciun-150-150.JPG
and
wuernicun-123-25.png
becomes wuernicun-150-150.png
so far I have got the last bit (file extension) figured out with /(jpg|JPG|jpeg|JPEG|gif|GIF|png|PNG)/
but the number part is really confusing basically the file will always be:
[string]-[2-4 numbers]-[2-4 numbers].[original file extension]
One day I will get around to reading the entire regex reference but it's baffling to me.