I would like to use RegEx title match mode and scan for an exact match of the exe name.
Therefore I would like to use the ^ and $ anchors. However the ^ does not really work with ahk_exe.
To go with an example, I am using it on the SciTe4AHK editor.
The code
Code: Select all
SetTitleMatchMode RegEx
If WinActive("ahk_exe ^SciTE\.exe$")
MsgBox true
else
MsgBox false
The code
Code: Select all
SetTitleMatchMode RegEx
If WinActive("ahk_exe ^.{34}SciTE\.exe$")
MsgBox true
else
MsgBox false
I can work around it using the \b anchor like this
Code: Select all
SetTitleMatchMode RegEx
If WinActive("ahk_exe \bSciTE\.exe$")
MsgBox true
else
MsgBox false
1) WHY does it not work? What chars are those 34 chars?
2) Is there a way around using the . {34} part and still use the ^ anchor?
Many thx in advance. Regards, S.