【发布时间】:2015-07-28 23:08:00
【问题描述】:
我正在尝试在每 4 个数字/数字(不是字符)中添加一个空格。这是我想出的:
newStudentNumber := regexp_replace(newStudentNumber, '[[:digit:]](....)', '\1 ');
dbms_output.put_line(newStudentNumber);
结果:
NL 2345 7894 TUE
我真正想要的:
NL 1234 5678 944 TUE
我的代码用空格键替换每 4 位的数字,而不是像上面想要的结果那样添加空格。
谁能给我解释一下?
提前致谢
【问题讨论】:
-
原始输入是什么?
-
原始输入是什么意思?想要的最终结果的输入还是我的整个代码?
-
有点看到那个来了。 regexp_replce = 替换。但是那怎么加空格呢?
-
是的..你展示了想要的结果和你得到的结果,但没有输入..
-
也许我不完全理解你,但我在顶部得到了我的输入:newStudentNumber := regexp_replace(newStudentNumber, '[[:digit:]](....)' , '\1'); dbms_output.put_line(newStudentNumber);或者这不是你所说的?
标签: regex oracle oracle11g dbms-output