Testing regex - great but not quite perfect yet?


#1

I just discovered your feature to test regular expressions in the query builder – that’s really great!
I wanted to clarify some issue though with case sensitivity though and the i flag.

  1. my tests seem to suggest that regex are case insensitive while your documentation makes it clear that regex are case sensitive.
    e.g. I test the regular expression z{3,10} expressions like ZZz will get a positive test result.
    when I try the regex (?i)z{3,100} from your examples, nothing seems to get matched.
    Thus my questions:
  • Do flags not work in the test?
  • Are the regex case sensitive?
  • Is case matching working properly in the test?
  • Or am I working from some other false assumption?

Thanks a lot.


#2

Can you please confirm exactly how you are testing your regex? Have you tried validating the regex you’re written anywhere else, such as on rubular.com?

We should fully support the RE2 engine, and match all flags and features provided in RE2


#3

Hi Jason,
I am using the graphical query builder. With it, I created a filter “Partial Regex”.
I put in z{3,10} in the regex field and press test. A text input field for the expression to test opens, and I put in ZZz. I get a green check mark, which indicates that the text ZZz matched the regex z{3,10}. see screenshot:

When I try to use the i flag for making everything case insensitive, the whole matching thing seems to break down. The result of the test (nothing, negative or positive) will be whatever was shown before I put in the flag. As illustrated by the three screenshots below.


#4


#5


#6


#7

thank you for pointing me to Rubular, I had not used this before. It works with the i-flag and default case sensitivity as expected:


#8

Is there any syntax problem that I am not aware of?

Thanks a lot.
Sabrina
P.S. The only reason I wrote 6 replies instead one was that I was not allowed to post more than one picture at at time and didn’t have a program at hand to stick them altogether.


#9

Thanks for the detailed explanation. I’ve successfully reproduced your issue, and have escalated it to our engineering team for further investigation.
You may wish to use the CSDL editor, rather than the visual Query Builder to build CSDL containing regular expressions while these problems persist