How to replace last character of a cell

Hi all,

I’ve need to achieve something which on the face of it seems relatively straightforward but i’m having issues identifying a working solution.

In a column, I have a list of page numbers e.g. page 1, page2, page 3a, page 3b page 4b, page 5, page 53a…

What I need to do is replace the trailing a (& not the a in the word page) with the string “-1”. Similarly, i need to replace the trailing b with the string “-2”.

I’ve tried a few different regex but i can’t get any to work.

Does anyone have an idea of how i can do this please?

Thanks in advance.

Pete