Formatting as Track Title (Artist)

Hello there

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.

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.

see e.g. here:

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.

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".

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)

1 Like

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?

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?

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%

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.

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

This doesn't make a difference either:

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

This doesn't do it either:

%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.

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

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

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)

1 Like

Thanks for clarifying!

That's close.

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

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

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

which is more or less what I meant

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

1 Like

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

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?

[#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%


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.

I was wondering if it was

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

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.

1 Like

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.

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
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.

Thanks for your replies.

This is what Bard says:

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