Skip to content

Extract values from a field and check whether any field values match a regular expression

Use the regexp_extract(key, '\d+') function to extract the first digit. Use the regexp_extract_all(key, '\d+') function to extract all digits. Use the regexp_extract_all(key, '(\d+)F') function to extract the string with the letter F next to digits. Use the regexp_like(key, '(\d+)t') function to check whether any field values match a regular expression. The results are displayed in a table.

SQL
|
SELECT
  key as "Original string",
  regexp_extract(key, '\d+') as "Extract the first digit",
  regexp_extract_all(key, '\d+') as "Extract all digits",
  regexp_extract_all(key, '(\d+)F') as "Extract the string with the letter F next to digits",
  regexp_like(key, '(\d+)t') as "Check whether any field values match a regular expression"