我想解析-之间的值。但是对于一些数据,比如第一个url包含--所以在这种情况下,我只需要获取间隙,而下一个我可以通过使用*(site_data,'[^-]+',1,2)*成功地获取**camry**。但我也想处理好差距。
U=Google--undefined|http://www.google.com/urlsa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=2&ved=0CFMQFjAB&url=http://www.toyota.com/tundra/features.html&ei=-zwQUvOyGIXu2QWC7oGgBg&usg=AFQjCNFQKGcr2dbDeC-0zagtYdKFEfXXzQ&bvm=bv.50768961,d.aWc
U=Bing-camry-undefined|http://www.bing.com/searchq=camry&pc=MOZI&form=MOZSBR请在这方面提供帮助。
发布于 2013-08-23 18:15:14
您可以提取字符串和连字符,然后修剪连字符。
trim('-' from regexp_substr(site_data,'-[^-]*-'))或者,您也可以使用regexp_replace函数。
regexp_replace(site_data,'(-([^-]*)-)|(.)','\2')https://stackoverflow.com/questions/18399820
复制相似问题