Variable

Dm114

Well-known member
Hey, I need help again. how about 'and'?
It all depends on what you want to achieve.

If you want a part of text containing the whole expression between 2 words (such as 'Tom' and 'Jerry' but not only 'Tom' nor 'Jerry'), you'll have to use a regex expression like:
(Tom.+Jerry)|(Jerry.+Tom)

If you want to check whether a text contains the 2 previous words, just check the result of the previous action above and if it is not empty, it means that the text is ok.

But, according to your needs, you can make it much simpler with an 'If...' action using the 'contains' condition.
 
It all depends on what you want to achieve.

If you want a part of text containing the whole expression between 2 words (such as 'Tom' and 'Jerry' but not only 'Tom' nor 'Jerry'), you'll have to use a regex expression like:
(Tom.+Jerry)|(Jerry.+Tom)

If you want to check whether a text contains the 2 previous words, just check the result of the previous action above and if it is not empty, it means that the text is ok.

But, according to your needs, you can make it much simpler with an 'If...' action using the 'contains' condition.
sample text: one two three four five

so I tried using this (one.+five) and it extract 'one two three four five' which is not what I wanted but a good info, what I want to extract is this two from the sample text: ('one' and 'four') for example so how can I achieve that?
 
If ever possible can you send me the link of all macrodroid's variable operators or from where did you learn those operators thanks
 
I found something similar, sample text: one two three four five

use (one)|(four)
and press full match under it
 
Last edited:

Dm114

Well-known member
sample text: one two three four five

so I tried using this (one.+five) and it extract 'one two three four five' which is not what I wanted but a good info, what I want to extract is this two from the sample text: ('one' and 'four') for example so how can I achieve that?
Sorry but I'm not sure I understand what you mean. If you want to extract 'two' from 'one two ... five' you just to type two in the search field.

But I think you'd rather want to know whether 'one' AND 'four' are included in the search string. In this case, the syntax I gave you first will return a non-empty string if both words are present.

The one you found (one)|(four) will return a string containing either 'one' or 'four' but will not grant that both are present.
 

Dm114

Well-known member
there's a number extractor like (55)*(56)*(57) and (55)?(56)?(57) it'll return the highest one it's cool
To extract numbers it's very easy (with something like \d+) but then you have to sort them in ascending/descending order or find the greatest/lowest one. It's a bit more complicated: there is no 'formula' (Regex syntax) to do that.
 
Top