Simple Regex in Bigquery
So one day I woke up and I was like:
So I booted up my free account and started typing:
with test as (
select 'ABCD1234' as field)
select regexp_extract(field, '[0-9]{1,3}') as extracted from test --retunrs 123
union all
select regexp_extract(field, '[0-9]{1,4}') as extracted from test -- returns 1234
union all
select regexp_extract(field, '[A-Z,0-9]{1,7}')from test