By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table reviews as
select 1 as r_id, 'Weight cannot exceed 40 kg' as comm from dual union all
select 2 as r_id, 'You must not make the weight go over 31 k.g' as comm from dual union all
select 3 as r_id, 'Don''t excel above 94kg' as comm from dual union all
select 4 as r_id, 'Optimal weight is 45 kg' as comm from dual union all
select 5 as r_id, 'Don''t excel above 62 kg' as comm from dual union all
select 6 as r_id, 'Weight cannot exceed 7000g' as comm from dual
6 rows affected
select r.*, regexp_substr(comm, '[0-9]+')
from reviews r
where regexp_like(comm, '(exceed|go over|above).*[0-9]+ ?(kg|k.g)')
R_ID | COMM | REGEXP_SUBSTR(COMM,'[0-9]+') |
---|---|---|
1 | Weight cannot exceed 40 kg | 40 |
2 | You must not make the weight go over 31 k.g | 31 |
3 | Don't excel above 94kg | 94 |
5 | Don't excel above 62 kg | 62 |