Using variables (label, number) in 2-way regex

Forum to ask for any help
Post Reply
cv27
Posts: 233
Joined: Sat Nov 24, 2012 10:15 pm
Location: Montréal, QC, Canada

Using variables (label, number) in 2-way regex

Post by cv27 » Mon Dec 26, 2022 10:09 pm

I use DemoPad to communicate with other applications (HomeSeer) via 2-way feedback. I need to either receive status updates from, or set values to devices, defined in HomeSeer. HomeSeer devices are referenced by a number.

For setting HomeSeer devices values, I can use labels or numbers as variables in the commands.

But for receiving status, for each HomeSeer device, I have five to ten 2-way rules where the device Id appears. That device Id can change in HomeSeer, forcing me to change each device reference in DemoPad five to ten times.

My feature request - give the ability to insert a label or number variable in the regular expression, in the 2-way configuration. I recognize that the variable would need to be bracketed using a character not found in regex. Perhaps a DemoPad specific escape character? For example, using the character '!' in a regex definition:

pattern = .....![label variable name].....
pattern = .....!{number variable name}.....

The benefit would be to replace one entity instead of numerous changes prone to error.

Post Reply