Trigger hotstring ONLY when preceded by alphanumberic characters

末鹿安然 提交于 2019-12-23 06:14:24

问题


I know about using ? in a hotstring (e.g. :?:btw::by the way) to allow the hotstring to fire after an alphanumberic character. However, is there a way to make it fire only when preceded by an alphanumberic character? For example, so it doesn't trigger on #btw or @btw or :btw or similar.


回答1:


The only thing i can think of is to make a hotstring for every alphanumeric character.

:?:abtw::by the way
:?:bbtw::by the way
:?:cbtw::by the way
.
.
.
:?:Ybtw::by the way
:?:Zbtw::by the way
:?:1btw::by the way
.
.
.



回答2:


The library RegEx Powered Dynamic Hotstrings can do this for you. Save the above library in the same directory as your script and run the following:

#Include DynamicHotstrings.ahk

hotstrings("[\w]btw", "btw") ; [\w] is the regular expression for a single character word
Return

btw:
    SendInput, by the way
Return


来源:https://stackoverflow.com/questions/17287501/trigger-hotstring-only-when-preceded-by-alphanumberic-characters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!