I'm trying to query a google bigquery table using the regex from this blog post. Here it is, slightly modified:
pd\.([^”,\.\(\,\`) \’:\[\]\/\\={}]*)
It does not, however, work in my google bigquery python client SQL query:
query_results = client.run_sync_query(
"""
SELECT
REGEXP_EXTRACT(SPLIT(content, '\n'),
r'pd\.([^”,\.\(\,\`) \’:\[\]\/\\={}]*)')
FROM
[fh-bigquery:github_extracts.contents_py]
LIMIT 10
""")
query_results.run()
data = query_results.fetch_data()
data
BadRequest: BadRequest: 400 Failed to parse regular expression "pd.([^”,.(\,`) \’:[]/\={}]*)": invalid escape sequence: \’