Aha! You completely placed the match (& replace) expression in single quotes.
I will use your suggestion. Thank you!
For those who came here from a search:
The aim is to set TITLESORT using TITLE as basis, moving articles, such as "the," to the end of the actual title of the track, that is, before ancillary attachments like features, mixes or bonus.
Therefore, we would have the following:
TITLE: Blah >> TITLESORT: Blah
TITLE: The blah >> TITLESORT: blah, The
TITLE: The blah (Feat. Jenny) >> TITLESORT: blah, The (Feat. Jenny)
TITLE: The blah (Feat. Jenny) [Radio Edit] >> TITLESORT: blah, The (Feat. Jenny) [Radio Edit]
Here is the corresponding regex that is applied to TITLESORT:
In general, it uses a condition ($if) to find titles that begin with articles ($regexp 1), and if so, traps the article as a variable and place it, preceded by a comma, at the end of the title but before the extra stuff in brackets ($regexp 2).
My final regex includes a modification: an asterisk (greedily matches 0 or more times) before the end of line anchor, "$."
Alternatively, and a little simpler without the prefixed conditional: