# Replace The Artist Name with Artist Name, The

**URL:** https://community.mp3tag.de/t/replace-the-artist-name-with-artist-name-the/66800
**Category:** Support
**Created:** [December 10, 2024, 7:36pm UTC](https://community.mp3tag.de/t/replace-the-artist-name-with-artist-name-the/66800 "2024-12-10T19:36:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sjkiss](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sjkiss/32/15612_2.png) [@sjkiss](https://community.mp3tag.de/u/sjkiss)
#### Post date: [December 10, 2024, 7:36pm UTC](https://community.mp3tag.de/t/replace-the-artist-name-with-artist-name-the/66800/1 "2024-12-10T19:36:45Z")

</div>

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:

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

```

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 10, 2024, 7:42pm UTC](https://community.mp3tag.de/t/replace-the-artist-name-with-artist-name-the/66800/2 "2024-12-10T19:42:10Z")

</div>

> [@sjkiss](#):
>
> `$regexpr(%albumartist%, (^The )(.+), $2, $1)`

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.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [January 9, 2025, 7:42pm UTC](https://community.mp3tag.de/t/replace-the-artist-name-with-artist-name-the/66800/3 "2025-01-09T19:42:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
