Search and replace in string at var

Hello everyone,
I’m using Asterisk version 1.4 and need to search and replace in string at var.
At the moment I have a macro to do the swap but it’s rather cumbersome process.
I know in theoretically that it possible to perform the operation through regular exprestion.
But I do not know the exact syntax.

I would appreciate examples if you have