2013-12-19 35 views
-3

检索值什么是正则表达式中postgres环境评估从下面的字符串值:reg表达式从数据

"((x.y.z == "test") OR (a.b.c intersects "test1") OR OR (pub.custom.channel intersects "test2,test3"))" 

需要输出为:test,test1,test2,test3

+0

在什么语言/环境/工具? –

回答

1

您可以使用此:

regexp_replace(subject, '(?:\A[^"]*)?"([^"]+)"[^"]+(?:"([^"]+)"[^"]*\Z)?', '\1,\2', 'g') 
+0

谢谢,它给我所期望的。 –