I’ve not worked out the detail but, from existing abbreviations I use, I suspect you can do that using RegEx. For example. I use the following abbreviations:
RegEx: (\d{2})(F|C)
Expansion: $1°$2
Result example: 20°C (the expansion inserts the superscripted degree sign in the temperature)
RegEx: ([\d])(in)
Expansion: $1"{^}
Result example: 16" (the expansion substitutes non-smart quotation marks for smart ones and places the cursor after the inch sign)
Sorry I’ve not had time to look at your specific case in more detail but I suspect you could do something like those examples.
Stephen