Regex and problem with brackets

I think I need a little assistance with regex in mp3tag.

Have > aaaa bbbb cccc dddd (xxx xxx xxx) [yyy yyy yyy]
Want > bbbb cccc dddd, aaaa (xxx xxx xxx) [yyy yyy yyy]

So I tried the following:

$regexp(%…%,^(.+?)\s(.+?)(\s'[([{]'.+?)*$,$2',' $1$3)

…but it resulted with:

bbbb cccc dddd, aaaa [yyy yyy yyy]

Any help is appreciated. I am too much in that I am just not seeing the solution. Thanks.

I have tried it with

$regexp(%comment%,'^(.+?)\s(.+?)(\s[[{(].*)$','$2, $1$3')

"aaaa bbbb cccc dddd (xxx xxx xxx) [yyy yyy yyy]" -> "bbbb cccc dddd, aaaa (xxx xxx xxx) [yyy yyy yyy]"

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: 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:
$if($eql($regexp(%title%,^(A|An|The|El|Los|La|Las|Le|Les|De)\s,),%title%),,$regexp(%title%,'^(.+?)\s(.+?)(\s[[{(].)$','$2, $1$3'))

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:
$regexp(%title%,'^(A|An|The|El|Los|La|Las|Le|Les|De)\s(.+?)(\s[[{(].)$','$2, $1$3')

$regexp(%TITLE%,'^(.+?)\s(.+)\s(\(.+)$','$2, $1 $3')

From: aa bb cc dd (xx xx) [yy yy]
To: bb cc dd, aa (xx xx) [yy yy]