title: Using another table in BigQuery Regex
body: <p>I would like to map a string column to a category based on a regular expression match. </p>
  
  <p>Is it possible to use another bigquery table containing the regular expressions and corresponding category for this? This would make it easier for me to update only a table when adding new categories/updating the regex, instead of having to update all queries that would use this lookup. </p>
  
  <p>Query:</p>
  
  <pre><code>CASE
   -- Use the entries from another table here
   WHEN REGEXP_MATCH(string_to_check, cat1regex) THEN cat1
   WHEN REGEXP_MATCH(string_to_check, cat2regex) THEN cat2
   etc.
  END
  </code></pre>
  
  <p>Mapping table:</p>
  
  <pre><code>Regex          category
  pagex|pagey    xy
  pagez|page1    z1
  </code></pre>
  
  <p>It's also possible there is another simple way to do something similar that I'm not thinking of, answers pointing those out are welcome too. </p>
  
  <p>Any help would be appreciated.</p>