To be more specific, if the original string column is like
- 'AAA 123 BBB 456'
- 'CCC 234 DDD EEE 678'
- 'FFFFF 7280 ZZZ 123 DDD'
what I need eventually is the first cluster of numbers only, like
- '123'
- '234'
- '7280'
TIA
Use regexp_extract
function:
select regexp_extract('AAA 123 BBB 456','[0-9]+',0) - digit one or more times
returns 123