Oh my God, Guys,
I've been searching for this for the last 3 weeks and nothing worked apart from this example code by
wizardzedd.
Thank you so much for posting this.
I am using it to match a subpattern in changing ClassNN of specific buttons in my account software.
Code: Select all
«::
; Skip to TRANSPORT button
winget, controls, ControlList, Achats|fournisseurs|Charges
Loop, Parse, controls, `n
if(RegExMatch(A_LoopField, "WindowsForms10.EDIT.app.0.(?:.*)_r38_ad114", Match))
; (?:.*)This is the symbol that allows the changing subpattern to exist in the button ClassNN
; My button is always ending with "_r38_ad114" but the subpattern is changing from file to file.
; This is why I needed a RexExMatch to get the full button ClassNN with its unique subpattern into the "Match" variable
; Having the Match variable with the new full ClassNN of the TRANSPORT Button, it can now be used as the Control's name and it works.
{
ControlClick, %Match%, Achats|fournisseurs|Charges,, Left
break
}
;MsgBox %controls%
;MsgBox %Match%
return