我有正則表達式的問題。regexp_replace POSTGRESQL
我想搜索的文字這樣' A ' - (space, BIG SINGLE CHAR and SPACE)
SELECT regexp_replace(' A Text B Text C Text a Text', '(([ ]{1}[A-Z]{1,1}[ ]{1}))', ' \1 ', 'g')
所以一切正常,但我想,以取代小焦這個單一的大字符。
SELECT regexp_replace(' A Text B Text C Text a Text', '(([ ]{1}[A-Z]{1,1}[ ]{1}))', lower(' \1 '), 'g')
不工作。
如何使用功能在此匹配\1
,例如lower()
得到結果
a Text b Text c Text a Text
?
謝謝。
你能發佈預期的輸出嗎? – nu11p01n73R 2014-10-30 11:59:57
'a Text b Text c Text a Text' 替換A B和C的小寫 – lukasz 2014-10-30 12:02:39