Page 1 of 1

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

Posted: Mon Dec 26, 2022 10:09 pm
by cv27
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.