How to I form an expression where IF the variable contains the word "cloud" (REGEX) then the condition can be true or false?
awdescription=matches(weather, "(?I).*rain.*")
...is what expression fills in for me when I choose the variable supplied by the auto weather plugin. How do I create a matches regex?
I really wish I understood all the stuff better, sorry for asking these questions that probably seem pretty straight forward to you guys, I do attempt to search all this stuff out before I ask on forums. I'm porting projects over from tasker and soon it will be all done then ill share some nice flows with everyone.
Regex and matches, expressions.
Moderator: Martin
Re: Regex and matches, expressions.
Hi,
You could also use function contains(weather, "cloud") or contains(toLowerCase(weather), "cloud") in a condition Expression to execute different actions in the flow.
A regular expression could look like this: matches(weather, '(?i).*cloud.*') (note that the i to switch the regex to case insensitive mode needs to be written in lower case).
Regards,
Martin
You could also use function contains(weather, "cloud") or contains(toLowerCase(weather), "cloud") in a condition Expression to execute different actions in the flow.
A regular expression could look like this: matches(weather, '(?i).*cloud.*') (note that the i to switch the regex to case insensitive mode needs to be written in lower case).
Regards,
Martin
Re: Regex and matches, expressions.
Thanks again Martin!