Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的输入值是这样的:
Value:123 with subvalues:[134,135,136]
我只想从中提取所有数字,并在它们至少由一个非数字字符分隔时保持逗号分隔。我现在正在使用这个:
regexp_replace(message, '[^[:digit:]]')
这会拉出数字,但显然甚至将这些数字之间的空格替换为空。我怎样才能得到结果:
123,134,135,136
select regexp_replace( regexp_replace( 'Value:123 with subvalues:[134,135,136]', '[^[:digit:]]+', ','), '^,+|,+$' ) as s from dual;
结果:
s --------------- 123,134,135,136