Create an exemption for "Orchestra" in ArtistSort

Hi
I have several actions to properly address classical artist tags. They all have on thing in common: they do an "artistsort" action at the end, that changes "firstname(s) surname" into "surname, firstname(s)" and creates an artistsort tag (even for multiple artists).

Only downside: whenever there is an orchestra name in the artist tag, of course you do not want the artiststort tag to read something like "Orchestra, London Philharmonic" or "London, Cinematic Orchestra of"

So: is there a way to add some term inside my already existing, various actions, that creates an exemption in the way of "if you encounter the terms Orchestra, Orchestre or Orchester, do not apply any sort-action to that specific "artist", but just copy the entire term as is to the artistsort tag - and only apply the artistsort-action to any other artists, that you might encounter inside the artist-tag".

Thanks for your ideas!

You would have to add that condition to every action in which you want an exception.
Or simply replace in the final result the "orchestra" with nothing.
I would assume that the resulting string sorts well enough.

Or if you find any kind of "Orchestra" in the original string, set the sort field back to the orginal data without anything swapped.

$ifgreater($strstr(%artist%,Orchestra),0,%artist%,%artistsort%)

I would suggest to use the Filter F3 first for all tracks that not include any form of orchestra names and then apply your Actions only to the listed tracks.

But, to be honest, catching all possible variants will not be easy.

Maybe, I should be more specific - should have done that in the first place, sorry!
Without needing to go into details about my various actions, they all have one thing in common: an artistsort-action at the end, that is as follows

$regexp($regexp(%artist%,(.?) (\w|\w*-\w*)('; '|$),$2', '$1; ),; $,)
edit: don't know, why the above code looks different, here's a normal copy&paste:
$regexp($regexp(%artist%,(.?) (\w|\w*-\w*)('; '|$),$2', '$1; ),; $,)

So, for example (the delimiter being ; )
Annie Fischer; Leonard Bernstein; London Symphony Orchestra
will be
Fischer, Annie; Bernstein, Leonard; Orchestra, London Symphony

But I want it to be
Fischer, Annie, Bernstein, Leonard; London Symphony Orchestra

It would be most sufficient for me, if there was an exemption, that says "for any artist identified between the delimiter ; that contains the word Orchestra, Orchester or Orchestre, do not apply the sorting action".
Does this explanation make more sense?
Thanks for your patience!

Before I invest any more brainpower:
Does that last bit of string really make a difference in sorting?
I would assume that if all the Fischer files are grouped together and then all those that Fischer and Bernstein performed together - how may will be left over that irritatingly appear at the later position of "O" instead of the earlier of "L".
I doubt that this makes a noticeable difference.

Just a quick note:

Are you sure that this regular expression convert
Annie Fischer; Leonard Bernstein; London Symphony Orchestra
correctly into
Fischer, Annie; Bernstein, Leonard; Orchestra, London Symphony

I can't reproduce this result:

This is just to make sure that future readers with similar approaches are aware of this.

Ahhh, I see, the Forum parser deleted some characters:

$regexp($regexp(%artist%,(.`*`?) (\w`*`|\w*-\w*)('; '|$),$2', '$1; ),; $,)

I added this code without highlighting in my above post, thanks for mentioning that!

$regexp($regexp(%artist%,(.*?) (\\w*|\\w\*-\\w\*)('; '|$),$2', '$1; ),; $,)

Is that the proper code now?

This is my working regular expression, except for the main Orchestra problem!
It looks like this (not heavily tested):

$regexp($regexp(%artist%,(.+?) (\w+|\w*-\w*)('; '|$),$2', '$1; ),; $,)

See here for proper code formatting: