Skip to content
Advertisement

How to extract everything after parentheses in BigQuery?

How can I extract all the characters after the first word?

For example, I would like to have (084M) in its own column with the parentheses included. I’ve tried to SPLIT and REGEXP_EXTRACT but I have ran into issues.

Table:

Name
Elizabeth (084M)
Elizabeth (084M)
Elizabeth (084M)
Pittston (14KN)
Pittston (14KN)
Pittston (14KN)
Cheektowaga (14ON)

Image of Table:
enter image description here

Advertisement

Answer

use below

select *,
  regexp_extract(name, r'w+s+(.+)')
from your_table
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement