regexp
語法: A regexp B?
操作類型: strings?
描述: 功能與rlike相同
注:rlike是正則形导,like是通配符
select * from pg_hist_user_goldcoin_inout where dtime regexp '2018-04-13 00:00:04' limit 12;
regexp_extract
語法: regexp_extract(string subject, string pattern, int index)?
返回值: string?
說明:將字符串subject按照pattern正則表達(dá)式的規(guī)則拆分环疼,返回index指定的字符。
select regexp_extract(product,'(\\w+).*?(\\w+)', 2) from pg_hist_user_goldcoin_inout where dt='20180501' and ntype=6;
注意:index=2朵耕,對應(yīng)的是pattern中第二個(gè)括號的內(nèi)容炫隶。若為0,則是括號內(nèi)全部內(nèi)容
regexp_replace
語法: regexp_replace(string A, string B, string C)?
返回值: string?
說明:將字符串A中的符合java正則表達(dá)式B的部分替換為C阎曹。
select regexp_replace("junjie.abc","junjie","abc"); ? -- 輸出: ? abc.abc