Need help with advanced filename to tags

Hi, my filenames are in format like:

%artist% - %title% (%remixer%) [%track%] {%album%}

My problem is that not always each tag is in the filename, for example sometimes there's no remixer, then my filename looks like this:

%artist% - %title% [%track%] (%album%)

And like that I have a few formats, depending on the information I have about a track. I would like to rename my whole selection at once but now I have to change my format string for each possible filename format, then select the files with similar format and process. Is there a way to automate this? Like searching if there's no [...] in the filename, then ignore the [%track%] in the format string. Or scripting like if file contains "(" AND "[" AND "{" use this format string and so on.

Any help appreciated!

You can be lucky tha you apparently have always filled TRACK as the square brackets enclose optional parts in the converter tag-filename.
If you want to keep the square brackets as literals, use '[' in apostrophes.
So, for your example with the likely missing remixer the mask looks like this:
%artist% - %title% [(%remixer%) ]'['%track%']' {%album%}

Hi ohrenkino, thanks for your reply. Square brackets as optional parts would be great but I tried every way but can't make this work. Are you sure this works for filename -> tag?

Sorry - did I read something wrong? I thought we were talking about tag-filename. probably my mistake prior to the afternoon cup of coffee.

Also apologies if I wasted your time - no, for the import of data you have to be exact.
So there is no way around than to apply sensible filters and then extract the data with the appropriate mask.