artyom.js
artyom.js copied to clipboard
Multiple wildcard in same command
Is there a way to use multiple wildcards in same command.
E.g. Set * to * where 1st wildcard is property name and 2nd wildcard is value.
I don't think itis possible. I also needed this feature a lot, so I came up with a way to do something similar.
Basically you set one wildcard like below
Set * //Example phrase: Set property1 to 3
Then in the action, you use regular expressions to filter out the words. I don't really know if you're supposed to use specific words, If it is that case then you can do something like:
eg:
var properties = ["property1", "property2"] var saidProperty; for (i = 0; i < properties.length; i++) {
if (wildcard.match(properties[i]) ) {
saidProperty = wildcard.match(properties[i]); } } var re = /[1-9]+/g; var saidValue = wildcard.match(re);