So I need to extract numbers from a varchar column.
create table test (USER_INPUT varchar);
insert into test (USER_INPUT)
values ('222 222'),
('Foo: 333333'),
('Bar blah blah 444444');
But when I try to:
select substring(USER_INPUT, '[\d\s]+') from test;
The number in the third row does not get parsed. What am I missing?
The output looks like this:
1 222 222
2 333333
3