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.
这是我需要完成的时髦匹配。
A5.1.9.11.2
需要变成:
A05.01.09.11.02
DOT 部分的数量从没有到很多不等。并且字母“A”将始终存在并且始终是 1 个字符。
我想使用 regexp_replace() 函数来将其用作排序机制。谢谢。
Oracle SQL 不支持环视断言,这对这种情况很有用:
s/([0-9](?<![0-9]))/0\1/g
您必须使用至少两个替代品:
REGEXP_REPLACE(REGEXP_REPLACE(col, '([0-9]+)', '0\1'), '0([0-9]{2})', '\1')