Skip to content

Instantly share code, notes, and snippets.

@frankyaorenjie
Created April 25, 2017 08:04
Show Gist options
  • Save frankyaorenjie/955e123c9d3058570b437134423751e9 to your computer and use it in GitHub Desktop.
Save frankyaorenjie/955e123c9d3058570b437134423751e9 to your computer and use it in GitHub Desktop.
bigquery regex
WITH params AS
(SELECT "[vtt_source=visenze_admin&error_page=5&error_limit=100]" as param
UNION ALL
SELECT "[__vs_inner=true&vtt_source=visenze_admin]" as param
UNION ALL
SELECT "[a=1]" as param)
SELECT
REGEXP_EXTRACT(param, r"vtt_source=(\w+)")
AS vtt_source
FROM params;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment