bosie
February 14, 2021, 10:40pm
1
hi there,
i am having a problem with case sensitive regex in my smart rules. this is the rule:
Scan text - regex - IE([0-9A-Z]*)
.
I output \1
with display alert
i would have expected to match on IE00BK5BQT80
but it matches on Wien
instead. it should neither match on ie
nor on the n
since it isn’t in the regex.
Content is literally just Wien is a test
what am i doing wrong here? How could i enforce case sensitivity? Thanks a bunch.
You can use (?i)
at the beginning for case-insensitive matches but I think there’s a bug here.
bosie
February 15, 2021, 10:11am
3
@BLUEFROG it seems to be case insensitive already.
unfortunately (-?)IE([0-9A-Z]*)
does not match THIS IENSDF
That’s correct and intentional (and consistent to searching in databases).
bosie
February 15, 2021, 11:03am
5
had a typo above (?-i)
works it seems.
not sure i agree with you as with a regex you can very explicitely search for things. [A-Z]
vs [a-z]
We might add an option to future releases.
1 Like
May I suggest to simply stick to what is common practice with REs? I.e. respect case-sensitivity unless the i flag is specified. Everything else is… unexpected. Although database search is case-insensitive, it does not permit REs anyway, so one does not really need alignment in this respect. My opinion, of course.
1 Like