# Artist Sort problem

**URL:** https://community.mp3tag.de/t/artist-sort-problem/7706
**Category:** Support
**Created:** [January 5, 2009, 1:20pm UTC](https://community.mp3tag.de/t/artist-sort-problem/7706 "2009-01-05T13:20:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![timmorris](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@timmorris](https://community.mp3tag.de/u/timmorris)
#### Post date: [January 5, 2009, 1:20pm UTC](https://community.mp3tag.de/t/artist-sort-problem/7706/1 "2009-01-05T13:20:19Z")

</div>

I'm using the following expression to set the artistsort field ^(.+)\s(.+)$ with the field being set to $2, $1.

This doesn't work for say Bob Marley & the Wailers - it generates Wailers, Bob Marley & The. It looks like I need to start from the front of the field.

Suggestions please.

Tim

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 6, 2009, 8:56pm UTC](https://community.mp3tag.de/t/artist-sort-problem/7706/2 "2009-01-06T20:56:08Z")

</div>

RE: ^(.+?)\s(.+?)\b  
rw: $2, $1

---

<div class="post-metadata">

### Author: ![timmorris](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@timmorris](https://community.mp3tag.de/u/timmorris)
#### Post date: [January 6, 2009, 9:12pm UTC](https://community.mp3tag.de/t/artist-sort-problem/7706/3 "2009-01-06T21:12:29Z")

</div>

Thanks, I've started going through the information at [http://www.regular-expressions.info/](http://www.regular-expressions.info/), but the learning curve is pretty steep. I tried a few changes, but they would fail on either type. I actually am trying to decifer your expression in plain english but can't get how the question marks work in this case.

Are there any other references I should follow? I'm starting to realise that if I get a handle on regex I'll be able to do much more clever things with MP3tag. I also use PSPad (initially because Slim Devices squeezecentre uses unix format files, but since then because it is a great text editor), and I can envisage using Regex with that from time to time.

Thanks again for your help.

Tim

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 6, 2009, 9:23pm UTC](https://community.mp3tag.de/t/artist-sort-problem/7706/4 "2009-01-06T21:23:29Z")

</div>

[http://www.regular-expressions.info/repeat.html](http://www.regular-expressions.info/repeat.html) ![:book:](https://community.mp3tag.de/uploads/default/original/1X/0036d5b68f6226c53f6c68abfd0a7b8096fd4505.gif ":book:")🙂

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [August 26, 2020, 8:13am UTC](https://community.mp3tag.de/t/artist-sort-problem/7706/7 "2020-08-26T08:13:26Z")

</div>


