Listen for Regex

Here you are welcome to post Push2Run feature requests
Post Reply
Ivo
Posts: 3
Joined: Tue Jan 25, 2022 3:12 pm

Listen for Regex

Post by Ivo »

I know that regex support has already been mentioned in a thread, and noted as maybe too advanced for the typical user.
Either way, i'll try my luck with this request as maybe an advanced user :D

Example:
There would be a checkbox to activate Regex mode

Allowing the following:

open forge
open magic
play forge
play magic
start forge
start magic


as

(open|play) (forge|magic)

For * scenatios, no need to resolve as this comes free with regex:
calculator *
to
calculator .*

For $ scenarios, maybe using regex named groups:
search for $
to
search (?<q>\w+)

Maybe even allow multiple custom named group to be applied to the parameter input:
Listen for: (show|display) infobox (?<p1>\w+) and (?<p2>\w+) please
Parameters: infobox "first param <p1> and the second param <p2>"
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for Regex

Post by RobLatour »

Thanks for the suggestion Ivo, I understand why people might want it and appreciate you have seen where it was asked for before.

I'll need to give it some thought, but since version 3.6 complicating matters for regex implementation is Push2Run's ability to use separating works. For example:

OK Google, turn off my office light and shut down my computer

But in truth, the one thing that complicates matters the most for regex is me understanding it fully enough to get right :-)

In any case, I'll give it some thought once I get the next version (4.0) out the door.

Teaser alert 4.0 will support something new as a trigger!
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for Regex

Post by RobLatour »

Ivo

I seem to be having success adding in Regex support, but I will need to do some more testing.

Would you be willing to try out a beta and provide your feedback?
Ivo
Posts: 3
Joined: Tue Jan 25, 2022 3:12 pm

Re: Listen for Regex

Post by Ivo »

I'll happily test out a beta and give feedback.
If you have some coding quesitons related to getting regex to work, I think I could also help.
I'm a PHP developer, from what I can tell the project is made in vb, but i'm sure it shouldn't be too complicated to implement.
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for Regex

Post by RobLatour »

OK, I will send you a link via e-mail shortly (I'm just doing some other changes right now and would like to square them away first).
(I have your e-mail from when you registered on this user forum)
Ivo
Posts: 3
Joined: Tue Jan 25, 2022 3:12 pm

Re: Listen for Regex

Post by Ivo »

sounds good.

side note:
i'm in uk time zone, so there might be a possiblilty of me not responding today.
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for Regex

Post by RobLatour »

Ivo,

Thanks again very much for this suggestion and your help.

The changes for Regex matching, using the 'Listen for' field, as well as using regex group values from the 'Listen for' field within the 'Open', 'Parameters', and "Keys to send' fields is now supported in version 4.2 released today.

An example can be found here
Post Reply