/* Title: Dynamic Hotstrings Function: hs Dynamically adds regular expression hotstrings. Parameters: c - regular expression hotstring a - text to replace hotstring with or a label to *Goto* About: License - Version 1.0 by Titan . - Licenced under GNU GPL . */ hs(c, a = "") { static d, b, q global $ v = `n,€,~$,Numpad,BS StringSplit, v, v, `, If !d { Loop, 104 Hotkey, % Chr(42 * !!RegExMatch(t := Chr(32 + (x := A_Index)) , "[a-z]")) . v3 . (x > 94 ? v4 . x - 95 : t), _hs Hotkey, %v3%%v5%, _hs } If a Return, !!b .= c . v2 . a . v1 If c = %v3%%v5% Return, !!q := SubStr(q, 1, -1) If GetKeyState("Shift", "P") or GetKeyState("Capslock", "T") StringUpper, c, c Else StringLower, c, c q .= SubStr(c, StrLen(v3) + !!InStr(c, v4) * StrLen(v4) + 1 + !!InStr(c, "*")) Loop, Parse, b, %v1% { If (c := RegExMatch(q, SubStr(t := A_LoopField, 1 , InStr(t, v2) - 1) . "$", $)) and t { f += RegExMatch(t, ".+" . v2 . "(.+)", l) SendInput, % "{BS " . StrLen($) . "}" Transform, l, Deref, %l1% If IsLabel(l) GoSub, %l% Else SendInput, %l% } } If f q = } _hs: hs(A_ThisHotkey) Return