If/Then logic to match pattern in a string?


I'm trying to determine if it's possible to use regex if/then logic to analyze a string in a field, and do "A" if a pattern is found, and "B" if it's not.

In plain English, I'm trying to parse the ArtistSort field, and for artists with the string "The" at the beginning of the name, I want to remove the string "The". For names without "The" at the beginning, I want to do something else.

I think I could probably accomplish this with some kind of hack involving multiple actions, but I'd love to know if one action could do this for me.

What I've been finding information on seems to be more along the lines of "If field A exists, do 'X'", rather than matching patterns within a given field.

Thanks in advance for any guidance,


In Mp3tag listview I have defined a column:

Name: ArtistSort

Value: $regexp(%ARTIST%,'^(The|A)\s',,1)
Sort by: $regexp(%ARTIST%,'^(The|A)\s',,1)


Thanks much for your reply. This gives me something to explore.

All best,