Best way to handle multiple format strings

What is the best way to handle the situation where you want to create tags from file names but the set of open files cannot be handled by a single format string? For a simple example, suppose some of the files are
Artist - Title
but others are
Title by Artist
I can create two different format strings in the history and then select the one that matches one file at a time. But I’d really like to process all the files at once, and have mp3tag pick the format string that matches each, by trying the first format string, then the second, etc, until one is matched.
I’m new to mp3tag but since the program has been around so long I have to think many others have thought about this and hopefully found a solution!

The best way is to filter the files for typical sequences that match a format string, marl all files in the result and then apply the coverter Filename->Tag. The Preview helps to control the result.

On top of the advice that @poster gave, I would like to add some philosophy:
The filename is an unstructured string - and assigning bits of the string to fields imposes a structure on the available data.
MP3tag cannot read and therefore it only relies on the pattern structure that you define. How should a program tell that, taking your example, the first part is the artist in one case and the title in the other.
So it is a different pattern that has to be treated differently.

As @poster suggested: filter for the patterns, e.g.
%_filename% HAS " by "
%_filename% HAS " - "