Syntax for REGEXP_MATCH

97 views
Skip to first unread message

Deborah Perez

unread,
Sep 17, 2019, 4:26:30 PM9/17/19
to AdWords API and Google Ads API Forum
Hi I am using Python 3.7 and Google Ads API Beta v2.

In building a query, I attempted to use the operator CONTAINS ALL  with the WHERE clause for campaign.name. I received this error: "CONTAINS ALL is not a valid operator to use with 'campaign.name' in WHERE clause. Valid operators: =, !=, LIKE, NOT LIKE, IN, NOT IN, IS NULL, IS NOT NULL, REGEXP_MATCH, NOT REGEXP_MATCH."

The LIKE operator does not take a list and I will be using a list. It seems REGEXP_MATCH may be helpful but I can't find documentation on how to use REGEXP_MATCH. Can someone give me an example so that I can see the proper syntax?

Thank you for your help

Google Ads API Forum Advisor Prod

unread,
Sep 18, 2019, 4:40:33 PM9/18/19
to dep...@horizonmedia.com, adwor...@googlegroups.com
Hi Deborah,

Can you please send me through reply privately to author the error message you are getting? The only valid operators for Google Ads API are the ones listed here and it doesn't include REGEXP_MATCH or NOT REGEXP_MATCH.

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UHH7Hf:ref

Deborah Perez

unread,
Sep 20, 2019, 12:20:48 PM9/20/19
to AdWords API and Google Ads API Forum
Hi,
I am also wondering if I can use the LIKE operator to filter by campaign.name to include the terms 'Brand' or 'Core' or 'Exact'. Not necessarily all three terms at once in the name. Is there such a thing as WHERE campaign.name LIKE '%Brand% or '%Core%' or '%Exact%'? This is why I was looking to use CONTAINS ANY or CONTAINS ALL or CONTAINS NONE with a list of terms.

Thank you for your help

Google Ads API Forum Advisor Prod

unread,
Sep 27, 2019, 5:11:43 PM9/27/19
to dep...@horizonmedia.com, adwor...@googlegroups.com
Hi Deborah,

You can use the Query Builder here to check if you queries are valid, including the LIKE and NOT LIKE operators.
Reply all
Reply to author
Forward
0 new messages