Hi Nirmita,
thank you for pointing me out to the Grammar Guide, but I already red it thorougly and could not find a precise reference on how to escape caracters in regular expressions. It says the regular expression uses the
re2 syntax, but I found out thru trial and error that many caracters need to be escaped as defined for the LIKE operator:
To match a literal [, ], %, or _ using the LIKE operator, surround the character in square brackets.
I tried the Google Ads Query Builder, but it does not seem to fully check regular expressions. On many occasions the query validator validated queries but at execution time the regular expression was invalid.
As to why I cannot use the LIKE operator, it's because I want to partial match many substrings, for example I'm trying to do the equivalent of:
WHERE campaign.name LIKE '%Google Ads%'" OR
campaign.name LIKE '%Google Analytics%'"
but the OR is not valid as per the grammar guide. So my workaround is to use a regular expression with an Alternative ( "|" ):
WHERE campaign.name REGEXP_MATCH ".*Google Ads.*|.*Google Analytics.*''It works fine if there is no space in the terms I'm looking for, but if there's a space I get the error "Request contains an invalid argument." at runtime.
So my question is, what is the official way in REGEXP_MATCH to match a literal " " (space), so I can make that kind of query work ? => ".*Google Ads.*|.*Google Analytics.*''
Thanks for you help, Francis