# Formatting as Track Title (Artist)

**URL:** <https://community.mp3tag.de/t/formatting-as-track-title-artist/62332>\
**Category:** Support\
**Created:** [October 8, 2023, 5:41pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332 "2023-10-08T17:41:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 8, 2023, 5:41pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/1 "2023-10-08T17:41:11Z")

</div>

Hello there

 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/d8f5051bd3256a786d74fec25062f3571d931832.png)

I have some code working well most of the time, but I'd like it to be able to cope with multiple artists if multiple feature in the %artist% tag.

```auto
TRACK
$num(%track%,2)

_FILENAME
%track% %title% (%artist%)

TITLE
%title% (%artist%)

```

I need a conditional statement for more than one artist. For example, often the formatting for more than one will feature \

Like "Adam Devine\Sarah Hyland\Flula Borg"

Should add to the filename and track title as (Adam Devine, Sarah Hyland & Flula Borg".

So it would need to be conditional on more than one artist, if two or more add & between last two. If more than two, need a comma too.

I'm not sure how to get this working effectively? Also, if there is a way to detect any other splits between multiple artists in this, that would be great.

---

<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:** [October 8, 2023, 5:50pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/2 "2023-10-08T17:50:35Z")

</div>

see e.g. here:

> [@Replace " / " with ", " except when there is only one " / " or it is the last " / ", then replace with " & "](https://community.mp3tag.de/t/replace-with-except-when-there-is-only-one-or-it-is-the-last-then-replace-with/56479/4):
>
> Then try the following: First (simple) replace all slashes / with a comma. Then try the following "Replace with regular expression": Search string: (.\*), (.\*) Replace with: $1 & $2 The greadiness will take care that this always happens only to the last comma.

Yet, i wonder why you add the already existing data from ARTIST to TITLE esp. as these 2 pieces of information are not separated by a unique character so that one could split the field easily again.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 8, 2023, 5:56pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/3 "2023-10-08T17:56:17Z")

</div>

Because once I have that data I change the %ARTIST% to the name of the album. I hate having VA or Various Artists in media players, I want everything to appear where I expect it based on the album it's in. For example, the worst offender is "Now That's What I Call Music". I extract the ARTIST and insert in filename and title so I can change the ARTIST and ALBUMARTIST to "Now That's What I Call Music".

---

<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:** [October 8, 2023, 6:13pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/4 "2023-10-08T18:13:38Z")

</div>

> [@sheepdisease](#):
>
> I hate having VA or Various Artists in media players, I want everything to appear where I expect it based on the album it's in.

There no obligation to use "VA" or "Various Artists".  
So, "Now that's what I call music" as ALBUMARTIST is OK, unifiying the ARTIST data to being the same as ALBUMARTIST is probably OK for normal albums, yet, the field ALBUMARTIST has been introduced in ID3V2 to cater for samplers where the artist varies from track to track.  
But everybody builds a collection to one's own requirements.  
Just a friendly hint: if you should ever want to change your mind and either remove the artist from the title and/or add it to the ARTIST field again, then this would be much easier if you use a separator that is usually not part of the title. I find brackets in many titles. I would suggest the underscore instead.

Coming to your original problem:  
Instead of ARTIST use `$regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2)`

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 8, 2023, 10:33pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/5 "2023-10-08T22:33:25Z")

</div>

> [@ohrenkino](#):
>
> $regexp($replace(%artist%,,', '),'(._), (._)',$1 & $2)

Thanks for your reply. I've been formatting the tags this way for a long time, I just did it a lot more manually before.

So to clarify?

```auto
TRACK
$num(%track%,2)
_FILENAME
%track% %title% ($regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2)
TITLE
%title% ($regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2)

```

Is that right or am I missing something?

---

<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:** [October 9, 2023, 5:23am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/6 "2023-10-09T05:23:21Z")

</div>

Have you tried it?

If you add the artist to the title anyway and you reformat the artist with ampersands and commas, then the correct data should already be in TITLE and you dont have to do the transformation of the ARTIST twice.  
So move the action to format the \_FILENAME behind the one that you use to format the TITLE and then format value the \_FILENAME with just %track% %title%

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 7:11am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/7 "2023-10-09T07:11:02Z")

</div>

> [@sheepdisease](#):
>
> `%title% ($regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2)`

Thank you, I have tried it (I see I missed a bracket at the end) and whilst it does function as my original did, it doesn't add anything after \\ to the TITLE and FILENAME.

```auto
%title% ($regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2))

```

 ![image](https://community.mp3tag.de/uploads/default/original/2X/9/93ce5d666cd125bd8d6a907324d68b13f6f7f476.png)

 ![image](https://community.mp3tag.de/uploads/default/original/2X/a/a68f2291a19cda1301c396e03a1fbbd923209f2d.png)

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 8:32am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/8 "2023-10-09T08:32:29Z")

</div>

> [@sheepdisease](#):
>
> `%title% ($regexp($replace(%artist%,\,', '),'(.*), (.*)',$1 & $2))`

This doesn't make a difference either:

```auto
%title% ($regexp($replace(%artist%,\,', '),'(.*)\s?\\\s?(.*)',$1 & $2))

```

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 8:47am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/9 "2023-10-09T08:47:34Z")

</div>

This doesn't do it either:

```auto
%title% ($regexp($replace(%artist%,\,', '),'(.*)\s?(?:\,|\\\s?)\s?(.*)',($1 & $2) ?: ($1, $2))

```

If two artists are listed, it adds the first artist, then doesn't add a closing bracket and misses any subsequent artists.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 9:09am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/10 "2023-10-09T09:09:17Z")

</div>

This closes the brackets, but doesn't add subsequent artists.

```auto
%title% ($regexp($replace($replace(%artist%,,', '), ' ', r'\s'), '(.)\\\s?(.)',r'(\1, \2 & \3)', r'g'))

```

---

<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:** [October 9, 2023, 9:43am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/11 "2023-10-09T09:43:47Z")

</div>

> [@sheepdisease](#):
>
> it doesn't add anything after \ to the TITLE

The `\\` ist just a visualisation of a multivalue field. You cannot replace them, but you can merge such fields.  
The expression would then be:  
`$regexp($meta_sep(artist,', '),'(.*), (.*)',$1 & $2)`

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 10:08am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/12 "2023-10-09T10:08:22Z")

</div>

> [@ohrenkino](#):
>
> $regexp($meta\_sep(artist,', '),'(._), (._)',$1 & $2)

Thanks for clarifying!

That's close.

 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/de666148cc9ab404b88380dee5043d4c9fd4256f.png)

All that's missing are the opening and closing brackets around the artist name list.

 ![image](https://community.mp3tag.de/uploads/default/original/2X/c/ce789cc0194089ae81d50d5a48e3ed01c19ecd8c.png)

```auto
TITLE
%title% $regexp($meta_sep(artist,', '),'(.*), (.*)',$1 & $2)

```

---

<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:** [October 9, 2023, 10:13am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/13 "2023-10-09T10:13:55Z")

</div>

> [@sheepdisease](#):
>
> `%title% $regexp($meta_sep(artist,', '),'(.*), (.*)',$1 & $2)`

-\> `%title% ($regexp($meta_sep(artist,', '),'(.*), (.*)',$1 & $2))`

which is more or less what I meant

> [@ohrenkino](#):
>
> Instead of ARTIST use `$regexp`

as your original expression already had the brackets around %artist%

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 10:22am UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/14 "2023-10-09T10:22:18Z")

</div>

> [@ohrenkino](#):
>
> %title% ($regexp($meta\_sep(artist,', '),'(._), (._)',$1 & $2))

Thank you very much. I am autistic and take things literally, which is why I was confused about the brackets missing.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 12:07pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/15 "2023-10-09T12:07:26Z")

</div>

So I'm trying to incorporate it into my bulk action but then all commas get changed to &?

What's causing that/what's the fix?

```auto
[#0]
T=9
! Remove Source=
F=SOURCE

[#1]
T=9
! Remove SourceID=
F=SOURCEID

[#2]
T=5
! Remove Text (Album, Digital Album, EP, LP, Single) from _DIRECTORY=
F=_DIRECTORY
1=$replace(%_directory%, '('Album')',, '('Digital Album')',, '('EP')',, '('LP')',, '('Single')',)

[#3]
T=5
! Remove Text (Album, Digital Album, EP, LP, Single) from _FILENAME=
F=_FILENAME
1=$replace(%_filename%, '('Album')',, '('Digital Album')',, '('EP')',, '('LP')',, '('Single')',)

[#4]
T=5
! Remove Text (Album, Digital Album, EP, LP, Single) from _ALBUM=
F=_ALBUM
1=$replace(%_album%, '('Album')',, '('Digital Album')',, '('EP')',, '('LP')',, '('Single')',)

[#5]
T=5
! Remove Leading Zero from Track 0-9=
F=TRACK
1=$num(%track%,2)

[#6]
T=5
1=%title% ($regexp($meta_sep(artist,', '),'(.), (.)',$1 & $2))
F=TITLE

[#7]
T=4
! Remove Total Number of Discs=
F=DISCNUMBER
1=^(\\d+)/\\d+
2=$1
3=0

[#8]
T=7
! Change Square Brackets with Round Brackets in Album, Artist and Title=
F=$replace(%album% \u003d\u003d\u003d %artist% \u003d\u003d\u003d %title%,'[','(',']',')')
1=%album% \u003d\u003d\u003d %artist% \u003d\u003d\u003d %title%

[#9]
T=5
! Change Square Brackets with Round Brackets in _FILENAME=
F=_FILENAME
1=$replace(%TRACK% %TITLE%,'[','(',']',')')

[#10]
T=4
! Force Lower Case on Conjunctions=
F=_TAG
1=\\\\b(A|An|The|And|But|Or|So|After|Before|Out|When|While|Since|Until|Although|Even If|Because|About|Above|Across|Against|Along|Alongside|As|At|Below|By|During|For|From|In|Into|Of|Off|On|Onto|Over|Than|Through|Till|To|Under|Up|With|Within|Without)\\\\b
2=$lower($1)
3=0

[#11]
T=4
F=_TAG
1=^\\\\s*(\\\\w+)
2=$caps($1)
3=0

[#12]
T=4
F=_TAG
1=(\\\\w+)\\\\s*$
2=$caps($1)
3=0

[#13]
T=4
F=_DIRECTORY
1=\\\\b(A|An|The|And|But|Or|So|After|Before|Out|When|While|Since|Until|Although|Even If|Because|About|Above|Across|Against|Along|Alongside|As|At|Below|By|During|For|From|In|Into|Of|Off|On|Onto|Over|Than|Through|Till|To|Under|Up|With|Within|Without)\\\\b
2=$lower($1)
3=0

[#14]
T=4
F=_DIRECTORY
1=^\\\\s*(\\\\w+)
2=$caps($1)
3=0

[#15]
T=4
F=_DIRECTORY
1=(\\\\w+)\\\\s*$
2=$caps($1)
3=0

[#16]
T=4
! Trim Trailing, Preceding & Extra Spaces [1]=
F=_DIRECTORY
1=(\\s+$|^\\s+)
2=
3=0

[#17]
T=4
! Trim Trailing, Preceding & Extra Spaces [2]=
F=_DIRECTORY
1=\\s+
2= 
3=0

[#18]
T=4
! Enforce Correct Word Spacing [1]=
F=_DIRECTORY
1=([^\\s\\.;\\)\\]/])([&\\({\\[\\+])
2=$1 $2
3=0

[#19]
T=4
! Enforce Correct Word Spacing [2]=
F=_DIRECTORY
1=(&|\\)|\\}|\\]|;|(?<!\\d),|,(?!\\d{3})|\\+)([^\\s\\.;\\(\\[/])
2=$1 $2
3=0

[#20]
T=4
! Enforce Correct Word Spacing [3]=
F=_DIRECTORY
1=\\b([a-z])\\s(&)\\s([a-z])\\b
2=$1$2$3
3=0

[#21]
T=4
! Enforce Correct Word Spacing [4]=
F=_DIRECTORY
1=([\\(\\[])\\s
2=$1
3=0

[#22]
T=4
! Enforce Correct Word Spacing [5]=
F=_DIRECTORY
1=\\s(\\]|\\)|\\?|:|;|,|\\.(?!\\.\\.))
2=$1
3=0

[#23]
T=4
! Enforce Correct Word Spacing [6]=
F=_DIRECTORY
1=(".*?")([^\\s\\]\\)/\\}!\\-\u003d,.;])(?!$)
2=$1 $2
3=0

[#24]
T=4
! Enforce Correct Word Spacing [7]=
F=_DIRECTORY
1=([^\\s\\[\\(/\\{])(".*?")
2=$1 $2
3=0

[#25]
T=4
! Enforce Correct Word Spacing [8]=
F=_DIRECTORY
1=(\\.(?<!\\.\\.))(?![\\s\\.':;\\)\\]"])(?![\\l\\u](\\.|$| ))(?!$)(?!\\d)(?!(co|com|uk|net|org|gov|edu|mil|html?|php))
2=$0 
3=0

[#26]
T=4
! Enforce Correct Word Spacing [9]=
F=_DIRECTORY
1=ww.\\s
2=ww.
3=0

[#27]
T=4
! Enforce Correct Word Spacing [10]=
F=_DIRECTORY
1="\\s?(.*?)\\s?"
2="$1"
3=0

[#28]
T=4
! Add Apostrophe to "Are" Contractions=
F=_DIRECTORY
1=\\b(how|they|what|when|why|you)re\\b
2=$1're
3=0

[#29]
T=4
! Add Apostrophe to "Have" Contractions=
F=_DIRECTORY
1=\\b(could|how|i|might|must|should|we|what|where|would|you)ve\\b
2=$1've
3=0

[#30]
T=4
! Add Apostrophe to "Is" Contractions=
F=_DIRECTORY
1=\\b(he|here|how|she|that|there|two|what|when|where|who|why)s\\b
2=$1's
3=0

[#31]
T=4
! Add Apostrophe to "Not" Contractions=
F=_DIRECTORY
1=\\b(ain|aren|can|couldn|didn|doesn|don|hadn|hasn|haven|isn|mightn|mustn|shouldn|wasn|weren|won|wouldn)t\\b
2=$1't
3=0

[#32]
T=4
! Add Apostrophe to "Will" Contractions=
F=_DIRECTORY
1=\\b(how|it|that|there|they|what|when|where|who|you)ll\\b
2=$1'll
3=0

[#33]
T=4
! Title Case Conversion [1] (Convert Words to Mixed-Case, Ignoring Upper-Case Letters)=
F=_DIRECTORY
1=([-({\\[\\]}) _",.+&@;*])(\\l)
2=$1$upper($2)
3=1

[#34]
T=4
! Title Case Conversion [2] (Capitalise First Word)=
F=_DIRECTORY
1=^(\\l)
2=$upper($1)
3=1

[#35]
T=4
! Title Case Conversion [3] (Articles, Conjunctions & Short Prepositions to Lower-Case, Except Before or After Punctuation)=
F=_DIRECTORY
1=(?<!&|:|;|-|/|!|(?<![A-Z]\\.[A-Z])\\.|\\?|\\+)(\\s+\\b(A|An|And|As|At|But|By|De|Et|For|From|In|Into|Le|Nor|Of|Off|On|Onto|Or|So|Than|The|To|Upon|Von|With)(?\u003d\\s)(?!\\s[\\-\\(\\)\\[\\]{}]))
2=$lower($1)
3=1

[#36]
T=4
! Title Case Conversion [4]=
F=_DIRECTORY
1=(^|\\s|\\(|\\[|/)'(.{1})
2=$1'$upper($2)
3=0

[#37]
T=4
! Title Case Conversion [5] (Capitalise "to" Before Common Verbs)=
F=_DIRECTORY
1=(to\\s+)\\b(Ask|Be|Begin|Believe|Bring|Buy|Call|Care|Change|Cheat|Come|Cry|Dance|Die|Do|Dream|Fall|Feel|Find|Forget|Get|Give|Go|Hate|Have|Hear|Hide|Hold|Keep|Know|Laugh|Learn|Leave|Let|Lie|Listen|Live|Look|Lose|Love|Make|Mean|Miss|Move|Marry|Need|Play|Pretend|Promise|Put|Remember|Return|Ride|Run|Say|See|Sell|Send|Set|Show|Sing|Speak|Stand|Stay|Steal|Stop|Take|Talk|Tell|Thank|Think|Touch|Travel|Try|Use|Wait|Walk|Want|Win|Wish|Work|Write)\\b
2=$caps($1)$2
3=1

[#38]
T=4
! Forced Upper-Case for Named Abbreviations and Acronyms=
F=_DIRECTORY
1=\\b(ac|aka|aol|ap|asap|atm|bbc|bc|bce|blt|btw|cbs|cc|cd|cia|dc|dj|doa|emi|ep|faq|fbi|fm|fr|gb|gi|gta|imho|ira|irs|jc|kkk|lp|mc|mgm|mtv||nasa|nbc|npr|ny|nyc|ok|ost|pm|ps|qed|rca|rpm|sos|tba|tlc|tv|ufo|uk|usa|ussr|va|ymca)\\b
2=$upper($1)
3=0

[#39]
T=4
! CamelCase Irish Names Beginning with O'=
F=_DIRECTORY
1=\\b(O'[a-z]|O\\x{2019}[a-z])
2=$upper($1)
3=1

[#40]
T=4
! CamelCase Scottish Names Beginning with Mc=
F=_DIRECTORY
1=\\b(Mc)((?:[a-z]|-){3,})
2=$1$caps2($2,-)
3=1

[#41]
T=4
! CamelCase Common Scottish Names Beginning with Mac=
F=_DIRECTORY
1=\\b(Mac)(Alister|Arthur|Askill|Bain|Coll|Donald|Dougall|Dowell|Duff|Ewen|Farlane|Gregor|Intyre|Kenzie|Kinnon|Laren|Lean|Leod|Millan|Nab|Neil|Pherson|Rae)\\b
2=$1$caps2($2)
3=0

[#42]
T=4
! Roman Numerals to Upper-Case (Up to LXXIX, or 89)=
F=_DIRECTORY
1=\\b(?:L?X{0,3}|XL)(?:V?I{0,3}|I[VX])(?\u003d(\\.\\s|\\s|\\)|$))
2=$upper($0)
3=0

[#43]
T=4
! Common Latinisms and Miscellany to Lowercase=
F=_DIRECTORY
1=(\\b(?:E\\.G|et\\sAl|Etc|I\\.E|Versus|Vs|Feat\\.\\s|Ft\\.\\s|(?<\u003d')N(?\u003d'))\\b)
2=$lower($1)
3=1

[#44]
T=4
! Trim Trailing, Preceding & Extra Spaces [1]=
F=_TAG
1=(\\s+$|^\\s+)
2=
3=0

[#45]
T=4
! Trim Trailing, Preceding & Extra Spaces [2]=
F=_TAG
1=\\s+
2= 
3=0

[#46]
T=4
! Enforce Correct Word Spacing [1]=
F=_TAG
1=([^\\s\\.:;\\)\\]/])([&\\({\\[\\+])
2=$1 $2
3=0

[#47]
T=4
! Enforce Correct Word Spacing [2]=
F=_TAG
1=(&|\\)|\\}|\\]|;|(?<!\\d),|,(?!\\d{3})|\\+)([^\\s\\.:;\\(\\[/])
2=$1 $2
3=0

[#48]
T=4
! Enforce Correct Word Spacing [3]=
F=_TAG
1=\\b([a-z])\\s(&)\\s([a-z])\\b
2=$1$2$3
3=0

[#49]
T=4
! Enforce Correct Word Spacing [4]=
F=_TAG
1=([\\(\\[])\\s
2=$1
3=0

[#50]
T=4
! Enforce Correct Word Spacing [5]=
F=_TAG
1=\\s(\\]|\\)|\\?|:|;|,|\\.(?!\\.\\.))
2=$1
3=0

[#51]
T=4
! Enforce Correct Word Spacing [6]=
F=_TAG
1=(".*?")([^\\s\\]\\)/\\}!\\-\u003d,.;:])(?!$)
2=$1 $2
3=0

[#52]
T=4
! Enforce Correct Word Spacing [7]=
F=_TAG
1=([^\\s\\[\\(/\\{])(".*?")
2=$1 $2
3=0

[#53]
T=4
! Enforce Correct Word Spacing [8]=
F=_TAG
1=(\\.(?<!\\.\\.))(?![\\s\\.':;\\)\\]"])(?![\\l\\u](\\.|$| ))(?!$)(?!\\d)(?!(co|com|uk|net|org|gov|edu|mil|html?|php))
2=$0 
3=0

[#54]
T=4
! Enforce Correct Word Spacing [9]=
F=_TAG
1=ww.\\s
2=ww.
3=0

[#55]
T=4
! Enforce Correct Word Spacing [10]=
F=_TAG
1="\\s?(.*?)\\s?"
2="$1"
3=0

[#56]
T=4
! Add Apostrophe to "Are" Contractions=
F=_TAG
1=\\b(how|they|what|when|why|you)re\\b
2=$1're
3=0

[#57]
T=4
! Add Apostrophe to "Have" Contractions=
F=_TAG
1=\\b(could|how|i|might|must|should|we|what|where|would|you)ve\\b
2=$1've
3=0

[#58]
T=4
! Add Apostrophe to "Is" Contractions=
F=_TAG
1=\\b(he|here|how|she|that|there|two|what|when|where|who|why)s\\b
2=$1's
3=0

[#59]
T=4
! Add Apostrophe to "Not" Contractions=
F=_TAG
1=\\b(ain|aren|can|couldn|didn|doesn|don|hadn|hasn|haven|isn|mightn|mustn|shouldn|wasn|weren|won|wouldn)t\\b
2=$1't
3=0

[#60]
T=4
! Add Apostrophe to "Will" Contractions=
F=_TAG
1=\\b(how|it|that|there|they|what|when|where|who|you)ll\\b
2=$1'll
3=0

[#61]
T=4
! Title Case Conversion [1] (Convert Words to Mixed-Case, Ignoring Upper-Case Letters)=
F=_TAG
1=([-({\\[\\]}) _",./+&@:;*])(\\l)
2=$1$upper($2)
3=1

[#62]
T=4
! Title Case Conversion [2] (Capitalise First Word)=
F=_TAG
1=^(\\l)
2=$upper($1)
3=1

[#63]
T=4
! Title Case Conversion [3] (Articles, Conjunctions & Short Prepositions to Lower-Case, Except Before or After Punctuation)=
F=_TAG
1=(?<!&|:|;|-|/|!|(?<![A-Z]\\.[A-Z])\\.|\\?|\\+)(\\s+\\b(A|An|And|As|At|But|By|De|Et|For|From|In|Into|Le|Nor|Of|Off|On|Onto|Or|So|Than|The|To|Upon|Von|With)(?\u003d\\s)(?!\\s[\\-\\(\\)\\[\\]{}]))
2=$lower($1)
3=1

[#64]
T=4
! Title Case Conversion [4]=
F=_TAG
1=(^|\\s|\\(|\\[|/)'(.{1})
2=$1'$upper($2)
3=0

[#65]
T=4
! Title Case Conversion [5] (Capitalise "to" Before Common Verbs)=
F=_TAG
1=(to\\s+)\\b(Ask|Be|Begin|Believe|Bring|Buy|Call|Care|Change|Cheat|Come|Cry|Dance|Die|Do|Dream|Fall|Feel|Find|Forget|Get|Give|Go|Hate|Have|Hear|Hide|Hold|Keep|Know|Laugh|Learn|Leave|Let|Lie|Listen|Live|Look|Lose|Love|Make|Mean|Miss|Move|Marry|Need|Play|Pretend|Promise|Put|Remember|Return|Ride|Run|Say|See|Sell|Send|Set|Show|Sing|Speak|Stand|Stay|Steal|Stop|Take|Talk|Tell|Thank|Think|Touch|Travel|Try|Use|Wait|Walk|Want|Win|Wish|Work|Write)\\b
2=$caps($1)$2
3=1

[#66]
T=4
! Forced Upper-Case for Named Abbreviations and Acronyms=
F=_TAG
1=\\b(aa|aaas|aarp|abc|abs|ac|acs|ada|adhd|adl|afk|afl|aids|aka|aka|ama|aol|ap|apa|apb|asap|atm|awol|bbc|bbiab|bbl|bbs|bc|bce|bf|bff|bffl|blt|brb|btw|cbs|cc|cd|cdc|cia|cps|csi|cst|dafb|dba|dc|dj|dmv|dnc|dnd|doa|dob|eds|emi|eod|ep|espn|est|eta|faq|fbi|fm|fr|fyi|gb|gf|gi|gj|gmta|gta|hagn|hiv|hr|idk|imho|imo|ira|irs|jc|jit|jrotc|kia|kkk|lmao|lol|lp|ltns|lylab|lylas|madd|mba|mc|md|mgm|mia|mla|mtv|nafta|nasa|nasdaq|nba|nbc|nfl|nhl|ni|nino|np|npr|nspcc|ny|nyc|nyob|ok|omg|osha|ost|ot|otc|pbs|pga|phat|pm|pos|potus|ppv|ps|pst|qed|rca|rnc|rofl|rpm|rspca|scotus|sos|spca|ssdd|ssn|suv|swak|swat|swf|swm|swot|tba|tbc|tbn|tlc|tnt|ttfn|ttyl|tv|ty|tyvm|ufo|uk|usa|ussr|va|wtg|wwe|ymca|yw)\\b
2=$upper($1)
3=0
! Artist UPPERCASE Conversion List (Initiate)=

[#67]
T=5
! Artist and Band UPPERCASE Conversion (Start)=
F=ARTIST_LIST
1=abba|adda|absrdst|acdc|ac dc|akdong musician|a$ap|awolnation|bkpr|blk jks|bts|chllngr|chvrches|chll pll|cnco|dfrnt|diiv|dmc|dnce|drwn|dtcv|dwntwn|dvsn|dvsr|exo-k|felly|fighter jets|grmln|haim|hcio|htrk|hxlt|inxs|jmsn|jpnsgrls|kaytranada|kda|kshmr|ladybaby|lany|lazerpunk|lee hi|lndn drgs|lnzndrf|lvndscape|lvthn|mgmt|mika|mk|mnek|mndrmnek|m\u00d8|ms mr|mstrkrft|neiked|nf|n sync|nsync|offaiah|partynextdoor|prgrshn|pwr bttm|pza|rdgldgrn|rkcb|rlyr|r\u00dcf\u00dcs du sol|rvivr|ry x|sbtrkt|shxcxchcxsh|sophie|stnnng|strfkr|swmrs|sza|tnght|tr/st|tts|tstr|walk the moon|wzrd|u2|u-kiss|ub40|unkle|wstrn|xennon|xtrmst|xyle|zayn|zz

[#68]
T=5
! Artist and Band (Artist Field) UPPERCASE Conversion=
F=ARTIST
1=$regexp(%artist%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)

[#69]
T=5
! Artist and Band (Album Field) UPPERCASE Conversion=
F=ALBUM
1=$regexp(%album%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)

[#70]
T=5
! Artist and Band (AlbumArtist Field) UPPERCASE Conversion=
F=ALBUMARTIST
1=$regexp(%albumartist%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)

[#71]
T=5
! Artist and Band (Title Field) UPPERCASE Conversion=
F=TITLE
1=$regexp(%title%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)

[#72]
T=5
! Artist and Band (FILENAME) UPPERCASE Conversion=
F=_FILENAME
1=$regexp(%_filename%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)
! Artist (Directory) UPPERCASE Conversion=

[#73]
T=5
! Artist and Band (DIRECTORY) UPPERCASE Conversion=
F=_DIRECTORY
1=$regexp(%_directory%,(?i)\\b(%artist_list%)\\b,\\U$1\\E)

[#74]
T=9
! Artist UPPERCASE Conversion List (End and Delete)=
F=ARTIST_LIST

[#75]
T=4
! CamelCase Irish Names Beginning with O'=
F=_TAG
1=\\b(O'[a-z]|O\\x{2019}[a-z])
2=$upper($1)
3=1

[#76]
T=4
! CamelCase Scottish Names Beginning with Mc=
F=_TAG
1=\\b(Mc)((?:[a-z]|-){3,})
2=$1$caps2($2,-)
3=1

[#77]
T=4
! CamelCase Common Scottish Names Beginning with Mac=
F=_TAG
1=\\b(Mac)(Alister|Arthur|Askill|Bain|Coll|Donald|Dougall|Dowell|Duff|Ewen|Farlane|Gregor|Intyre|Kenzie|Kinnon|Laren|Lean|Leod|Millan|Nab|Neil|Pherson|Rae)\\b
2=$1$caps2($2)
3=0

[#78]
T=4
! Roman Numerals to Upper-Case (Up to LXXIX, or 89)=
F=_TAG
1=\\b(?:L?X{0,3}|XL)(?:V?I{0,3}|I[VX])(?\u003d(\\.\\s|\\s|\\)|$))
2=$upper($0)
3=0

[#79]
T=4
! Common Latinisms and Miscellany to Lowercase=
F=_TAG
1=(\\b(?:E\\.G|et\\sAl|Etc|I\\.E|Versus|Vs|Feat\\.\\s|Ft\\.\\s|(?<\u003d')N(?\u003d'))\\b)
2=$lower($1)
3=1

[#80]
T=5
! Replace square brackets with round=
F=_FILENAME
1=%TRACK% %TITLE%

```

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 9, 2023, 12:36pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/16 "2023-10-09T12:36:55Z")

</div>

You posted 604 lines of Actions.  
Sorry, but do you really expect that someone will search your comma-error in it?

You have to inspect every single `$replace` and `$regexp` for the part, where you replace a comma with an & character.

If you know for what tagname your error occurs, you can reduce the search to the actions including this specific tag name.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 1:01pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/17 "2023-10-09T13:01:03Z")

</div>

I was wondering if it was

```auto
[#46]
T=4
! Enforce Correct Word Spacing [1]=
F=_TAG
1=([^\\s\\.:;\\)\\]/])([&\\({\\[\\+])
2=$1 $2
3=0

```

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [October 9, 2023, 1:08pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/18 "2023-10-09T13:08:57Z")

</div>

There are so many exceptions in music, you have to be careful about running a massive Action script like this. Artists intentionally use spelling and characters in their names, albums, and song titles. I personally would break this into smaller separate Actions and run them as needed on select files only. At least that would let you review the results quickly and undo them if something doesn’t go as expected.

At least have a complete backup ready.

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 9, 2023, 1:16pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/19 "2023-10-09T13:16:33Z")

</div>

> [@sheepdisease](#):
>
> `([^\\s\\.:;\\)\\]/])([&\\({\\[\\+])`

This is not a valid and working regular expression to copy & paste. You can test it in one of the many online testing tools like [this](https://uzitech.github.io/regexper/).

Or you paste it in the converter TAG -\> TAG and check if you get the desired result or just an "Invalid Syntax" error.

If you use it like this:  
`([^\s\.:;\\)\]/])([&\\({\[\+])`  
it means:

![image](https://community.mp3tag.de/uploads/default/original/2X/b/b599d4f436a8075582b364cfb4f42da1ff3950ee.png)  
I'm not sure if this could work at all. For example with the Slash \ once in the group #1 and at the same time in the group #2.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [October 9, 2023, 1:26pm UTC](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332/20 "2023-10-09T13:26:24Z")

</div>

> [@sheepdisease](#):
>
> ([^\s\.:;\)\]/])([&\({\[\+])

Thanks for your replies.

This is what Bard says:

```auto
The regular expression ([^\\s\\.:;\\)\\]/])([&\\({\\[\\+]) matches any non-whitespace character followed by either an ampersand (&), a left parenthesis ((), a left square bracket ([]), or a plus sign (+).

The regular expression can be broken down into the following parts:

([^\\s\\.:;\\)\\]/): This matches any non-whitespace character. The ^ character at the beginning of the expression negates the set of characters that follow it, so this expression will match any character that is not a whitespace character, a period (.), a colon (:), a semicolon (;), a right parenthesis )), or a slash (/).
([&\\({\\[\\+]): This matches an ampersand (&), a left parenthesis ((), a left square bracket ([]), or a plus sign (+).
The entire regular expression is enclosed in parentheses. This is done so that the matched characters can be replaced with something else.

For example, the following code replaces all commas (,) in a string with ampersands (&):

import re

string = "This, is a, test."

# Replace all commas with ampersands
string = re.sub(r"([^\\s\\.:;\\)\\]/])([&\\({\\[\\+])", r"$1 $2", string)

print(string)
Output:

This & is a & test.
This regular expression can be used in a variety of ways to manipulate text. For example, it could be used to:

Remove text from a string
Separate text into different parts
Change the case of text
Replace certain characters with other characters

```

[Next page](https://community.mp3tag.de/t/formatting-as-track-title-artist/62332.md?page=2)
