I'm curious to know if anyone has a workaround for this problem: Does anyone know a way to use wildcard characters in a window declaration's tag to identify a window by a window caption mask?

Here is the situation: I have 1-3 windows open at a given time. I've tried to use their indexes or Window IDs for their tags, but they appear to randomly assign the index and Quality works can't identify a Window ID for them (though it does have Window IDs for sub-panes of the window), so it's not selecting the appropriate window consistently.
I know I can identify each window by a subset of the window caption. The window captions that can be open at the same time are of the format:

<file information> - <variabletext>(<unique text> )

<text> changes with the currently open file, so I would need a separate window declaration for each file, which is not a very good option. Is there some way the window declaration can define wildcards in a caption-based tag without having to rely on Window ID? For example:

window ChildWin foo1
tag ''*(footext)*''
window ChildWin foo2
tag ''*(foo2text)*''
Where foo1 would pick up windows with the following captions:
''File1 - (footext) (1s)''
''File22 - (footext) (1s)''

and foo2 would pick up:
''File1 - (foo2text)''
''Window 2 - (foo2text) abc''
(This assumes of course that only one window with ''(footext)'' (and/or ''(foo2text)'') in its caption can be open at one time)