Replace The Artist Name with Artist Name, The

Hi there, how do I set the albumartistsort field to be Artist Name, The if the Album Artist is The Artist Name. I tried this:

Format Tag Field
$regexpr(%albumartist%, (^The )(.+), $2, $1)

But it just replaces the artist name with $2, $1.
What am I missing?

If that is the real format string ...
$regexpr -> $regexp
And I am not sure about the extra spaces follwin the commas.
I would use
$regexp(%albumartist%,(^The )(.+),'$2, $1')

And a note on the contents: I don't think that the "the" is still required for proper sorting. You could just as well simply delete it.