# Hotstrings() [v2.56]

作者: Titan 最近更新时间: nonexistent

Dynamically adds regular expression hotstrings.

hotstrings(k, a = "")

关于函数的参数和返回值, 请参阅其源码.

#### 备注

It is not strictly stdlib conform, because it uses a global variable.

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/topic16367.html

#### 许可

此函数(集)是基于 Simplified BSD 许可的开源项目. 想了解许可详情, 请参见 titan-license.txt

#### 示例

    ; #Include Hotstrings.ahk
    #NoEnv
    SendMode Input
    SetWorkingDir %A_ScriptDir%

    ; hotstrings("(B|b)tw\s", "%$1%y the way") ; type 'btw' followed by space, tab or return
    ; hotstrings("i)omg", "oh my god{!}") ; type 'OMG' in any case, upper, lower or mixed
    ; hotstrings("\bcolou?r", "rgb(128, 255, 0);") ; '\b' prevents matching with anything before the word, e.g. 'multicololoured'

    hotstrings("now#", "%A_Now%")
    hotstrings("(B|b)tw", "%$1%y the way")
    hotstrings("(\d+)\/(\d+)%", "percent") ; try 4/50%
    Return

    percent:
    p := Round($1 / $2 * 100)
    Send, %p%`%
    Return