RegExHotstring - dynamic RegEx Hotstrings

Post your working scripts, libraries and tools.
oldstone
Posts: 13
Joined: 28 Oct 2021, 07:29

Re: RegExHotstring - dynamic RegEx Hotstrings

05 Feb 2024, 03:53

If it can support '# IfWin' and '# HotIf', it will be more powerful and practical. Eagerly anticipating。
8LWXpg
Posts: 41
Joined: 26 May 2022, 03:55

Re: RegExHotstring - dynamic RegEx Hotstrings

05 Feb 2024, 06:39

oldstone wrote:
05 Feb 2024, 03:53
If it can support '# IfWin' and '# HotIf', it will be more powerful and practical. Eagerly anticipating。
This is because there's no general API to work with #HotIf in AutoHotkey. It will only work if AutoHotkey supports it in a future update.
fmoon
Posts: 2
Joined: 09 Feb 2024, 12:08

Re: RegExHotstring() dynamic RegEx Hotstrings

09 Feb 2024, 12:28

Hello,
I can't trigger the RegEX if it containts more than one word.
for exemple I want to tringer it when ever I type @Robot commande param1 param2 , it shoud execute the commande function with param1, param2

Code: Select all

RegExHotstring("@Robot\s(commande)\s(param1)\s(param2) /t}", commande , "C*") ; the trigger can be space or tabulation. 
@8LWXpg , can you help make it work?

Thank your for your support.
8LWXpg wrote:
23 Feb 2023, 08:35
frabjous wrote:
20 Feb 2023, 16:25
This script is excellent but I am having trouble creating a dynamic hotstring which is triggered by either a space or a punctuation mark at the end of the entered text. I thought I could do this with the recently added "no end key" option and including the punctuation marks in the hotstring (along the lines "[.,;: ]") but then I cannot make it work when a space is typed. Am I missing something?
current work around is to make two separate hotstrings, one take "[.,;:]" at the end and use "*" option, another doesn't.
8LWXpg
Posts: 41
Joined: 26 May 2022, 03:55

Re: RegExHotstring() dynamic RegEx Hotstrings

09 Feb 2024, 23:05

fmoon wrote:
09 Feb 2024, 12:28
Hello,
I can't trigger the RegEX if it containts more than one word.
for exemple I want to tringer it when ever I type @Robot commande param1 param2 , it shoud execute the commande function with param1, param2

Code: Select all

RegExHotstring("@Robot\s(commande)\s(param1)\s(param2) /t}", commande , "C*") ; the trigger can be space or tabulation. 
@8LWXpg , can you help make it work?

Thank your for your support.
as said in the readme, it's unable to match white space characters.
AladdinMhemed
Posts: 13
Joined: 09 Jan 2019, 16:52

Re: RegExHotstring - dynamic RegEx Hotstrings

25 Feb 2024, 00:48

is there an option to cancel the replacement on a condition in the callback?
for example

Code: Select all

rand(match) {
        if (match[0] != 'aaa') {
           ; cancel and don't replace and return
        } 
	static char := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	static char_len := StrLen(char)
	loop match[1] {
		r := Random(1, char_len)
		str .= SubStr(char, r, 1)
	}
	SendText(str)
}
8LWXpg
Posts: 41
Joined: 26 May 2022, 03:55

Re: RegExHotstring - dynamic RegEx Hotstrings

25 Feb 2024, 04:41

AladdinMhemed wrote:
25 Feb 2024, 00:48
is there an option to cancel the replacement on a condition in the callback?
You have two ways:
  • Catch the trigger string and send it back.
  • Use the B0 option to suppress the trigger string remove, then send backspace characters equal to the length of the trigger string, followed by the replace string.
Jasonosaj
Posts: 51
Joined: 02 Feb 2022, 15:02
Location: California

Re: RegExHotstring - dynamic RegEx Hotstrings

26 Feb 2024, 11:30

Alright, Ladies and Gents: how's everyone using this? Great function, by the way!

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: No registered users and 40 guests