-
Notifications
You must be signed in to change notification settings - Fork 72
/
RegEx_HotString.ahk
46 lines (37 loc) · 1.19 KB
/
RegEx_HotString.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; Title: https://www.autohotkey.com/boards/viewtopic.php?p=321060
; Link:
; Author:
; Date:
; for: AHK_L
/*
text =
(
===============================================================================
Find these AHK commands:
::xcx:: ; HotString
:*:yyz:: ; HotStringNoSpace
>^F7:: ; Right <Ctrl>+<F7> HotKey
>!F6:: ; Right <Alt>+<F6> HotKey
#Z:: ; <Windows><Z> HotKey
<!^+Home:: ; Left <Ctrl><Alt><Shift><Home> HotKey
<!^+End:: ; Left <Ctrl><Alt><Shift><End> HotKey
^!d:: ; <Ctrl><Alt><D> HotKey
~^!d:: ; <Ctrl><Alt><D> and OS sees d HotKey
=================================================================================
)
hotstrings := RegExFindHotstrings(text)
*/
RegExFindHotstrings(text) {
hotstrings := Array()
Loop, parse, text, `n, `r
{
i := A_Index
if RegExMatch(A_LoopField, "O)^\h*((?<HotString>::\S+)|(?<HotStringNoSpace>:\*:\S+)|(?<HotKey>\S+))::", m) {
for k, v in ["HotString", "HotStringNoSpace", "HotKey"]
if (m[v] != "")
break
hotstrings.Push := {"name":v, "value":m[v], "line":i}
}
}
return hotstrings
}