In notification received/SMS received trigger, there is no option to select case insensitive option when regular expression enabled

gauthambhat025

New member
I have a macro in which notification received/SMS received is the trigger. I have selected expression matching as in the screenshot. But when the notification/SMS recived contains same word but case (upper/lower) is different, it is not triggering. I see there is no option to select case insensitive option when regular expression enabled. Pls help. Screenshot attached.

I have a long list of such notification to match, so possibility of mentioning every combination of upper& lower case of each word is impossible.
 

Attachments

  • Screenshot_20240501-223246.png
    Screenshot_20240501-223246.png
    332 KB · Views: 10

Andydroid

Member
Doesn't the ticked and greyed out "case insensitive" box mean that it already matches any case? Or at least is supposed to?

If not, it would be nice if the box could be enabled so that we don't need to use "(?i)"
 

Endercraft

Moderator (& bug finder :D)
I thought that with regular expression matchig enabled codes didn't work. What does expression matching actually do then? What changes?
Regular expression does insensitive matching unless you use the i option, but as we can't do that in MacroDroid RegEx also allows for inline modifiers.
Doesn't the ticked and greyed out "case insensitive" box mean that it already matches any case? Or at least is supposed to?
No, the box is not taken into account when RegEx matching is enabled.
 

Dm114

Well-known member
Which one of the following is correct?, any difference in these 2 cases-

1. (?i)(debit|credit)
2. (?i)(debit)|(credit)|
Both are correct but #1 is "lighter"

There are thousands of sites on the internet, so don't hesitate to G**gle a bit...
 

MacroDroidDev

Administrator
Staff member
I noticed that there was some inconsistent behaviour throughout the app where some regex were converting to lower case before checking and some were not. Some has the option for case sensitivity and some didn't. The easiest fix was just to disable this for regex as you can use the regex expression to ignore case if you want that.

I could consider enabling the option again (and implement it properly by just prepending the (?i) when the option is enabled.
 

Dm114

Well-known member
I noticed that there was some inconsistent behaviour throughout the app where some regex were converting to lower case before checking and some were not. Some has the option for case sensitivity and some didn't. The easiest fix was just to disable this for regex as you can use the regex expression to ignore case if you want that.

I could consider enabling the option again (and implement it properly by just prepending the (?i) when the option is enabled.
In my opinion, I think it's better as it is now: it allows the user to choose the exact position of the (?i) inside its Regex rule. It is much more versatile rather than prepending it for the whole expression...
 
Top