with t as ( select '50mg' txt from dual union all select '50kg_50mg' from dual union all select '50' from dual union all select 'mg50' from dual union all select 'mg good' from dual union all select '50mg50' from dual union all select '50m' from dual union all select 'mg' from dual union all select '1mg' from dual union all select '50g' from dual ) select * from t where regexp_like(txt, '^[0-9]+mg$')