1. Is it possible to match unknown length wild cards?
yes as long as the maxlength is higher than the unknown length
in the regex pattern [a-zA-Z]{3,5} matches any letters 3 to 5 characters long the {3,5} the 3 is the min number to match the 5 is the max. can change either number. The [] means characters in set. So could do
[a-zA-Z0-9]{3,50} which would match any group of letters and or letters and numbers 3 to 50 characters long
2. Is it possible to include characters other than letters in the wildcard e.g. "-","%","+" etc and multiple wildcards at different points in the window name?
yes
regular expressions are a very powerful tool
will match name test followed by any character 3-50 in length followed by black followed by any character 3-50 in length
another quick example for a more complicated search with random characters in the middle and the end
Function RandomNotepadName2
yes as long as the maxlength is higher than the unknown length
in the regex pattern [a-zA-Z]{3,5} matches any letters 3 to 5 characters long the {3,5} the 3 is the min number to match the 5 is the max. can change either number. The [] means characters in set. So could do
[a-zA-Z0-9]{3,50} which would match any group of letters and or letters and numbers 3 to 50 characters long
2. Is it possible to include characters other than letters in the wildcard e.g. "-","%","+" etc and multiple wildcards at different points in the window name?
yes
regular expressions are a very powerful tool
will match name test followed by any character 3-50 in length followed by black followed by any character 3-50 in length
another quick example for a more complicated search with random characters in the middle and the end
Function RandomNotepadName2
int w
run "$system$\notepad.exe" "" "" "" 0x800 win("" "Notepad") w
rep 10
,str mp ep
,mp.RandomString(3 50)
,ep.RandomString(3 50)
,_s.format("test %s black %s" mp ep)
,_s.setwintext(w)
,0.3
,int w1=win("test .{3,50} black .{3,50}" "Notepad" "Notepad" 0x200)
,act w1
,1
,act _hwndqm
,1