I have found a soultion for GNU sed, and I also found something like \1
, but the Terminal tells me it's "not defined in RE".
But what I want to do is this:
If I have a string that looks like this sinder-city1.gif
, I want to make that sinder-city.gif
, now I can't just straight up replace the entire string, because I will do this to many different strings, nor can I just remove all numbers before .gif or some other pattern because if there is
sinder-city2.gif
sinder-city3.gif
I want them to stay intact.
I don't want to replace that. For matching that, I type sed 's,[a-z]1.gif,
but if I remove that, I will be left with sinder-cit.gif
. How do I match that y
?
I want to do like this:
sed 's,[a-z]1.gif,[here is the last letter].gif,g'
It has to work on BSD sed.