我有一个字符串,我需要在 OF 之前和之后的单词之间设置空格。但是如果它最后是 OFF,那么它应该保持原样。请纠正我的表达方式或者如果有更好的写作方法。
PRINCEOFPERSIA ==> PRINCE OF PERSIA
PRINCOFFINLAND ==> PRINCE OF FINLAND
Blowoff ==> Blowoff
Spinoff ==> spinoff
I have written this exp.
Select REGEXP_REPLACE(spinoff,'(\w*)(off?)(.*)$','\1 \2 \3') from dual;
but it breaks it as 'spin off'