I am looking for pattern matching in GridDB using NewSQL to return values true when matched and false when not matched.
The string can start with
91followed33followed by 8 digit number followed by upper case letters eg913312345678JAYP(should return true)0followed33followed by 8 digit number followed by upper case letters eg03312345458MARYP(should return true)Starts with
33followed by 8 digit number followed by upper case letters eg3312345458TOMH(should return true)
If the string does not start with 91/0/none followed by 33 and 8 digit number and then letters it should return False. Below are some examples:
53312345458RYANH --invalid
3312345458 --invalid
03312345458JAYP8 --invalid
Can anyone help with with solution. I used the function GLOB and it does not have the OR option so that I can choose between 0/91/none.
glob('33[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][A-Z]*', your_column) OR glob('033[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][A-Z]*', your_column) OR glob('9133[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][A-Z]*', your_column)^(0|91)?33\d{8}[A-Z]+$. Regex 101 - btw why03312345458JAYPis invalid?