artyom.js icon indicating copy to clipboard operation
artyom.js copied to clipboard

Multiple wildcard in same command

Open gaurav110 opened this issue 5 years ago • 1 comments

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.

gaurav110 avatar May 09 '19 06:05 gaurav110

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);

kaiknox avatar Jul 09 '20 12:07 kaiknox