python使用正则表达式提取文本中的中文项

'kong=\'\';var line_points=\'\';var line_runtime=\'\';kresult+="m5aa28c34|m5c626c4a|";\r\nvar m5aa28c34= new Array("169路去程","市区线路","水晶城 05:20-19:15 |长白港湾站 06:15-20:15","无人售票,投币每人次1元,IC卡有效","沈阳安运巴士有限公司","169路车型由XML6102UE52型更换为黄海DD6118S13型客车,线路配车为34台,来源于162路。","EUVSHJDZJUJUWRA","EUVSVSHZJUSDVWR|水晶城|148路@2deb8f03,169路@af7e1089","EUVTAIUZJUSCBEA|水晶城街八家子|148路@2deb8f03,148路@2deb8f03,169路@af7e1089,169路@af7e1089","EUVWAHSZJUSBHHC|水晶城街一汽福达|148路@2deb8f03,148路@2deb8f03,169路@af7e1089,169路@af7e1089","EUVUUGSZJUSAABG|良城美景|107路@9c557848,107路@9c557848,112路@94192360,112路@94192360,133路@d810a85c,133路@d810a85c,168路北线@2e2b17a2,168路南线@d0229eed,168路北线@2e2b17a2,168路南线@d0229eed,169路@af7e1089,169路@af7e1089,218路@8beac754,218路@8beac754,384路@e0499228,384路@e0499228,385路@7a32571f,385路@7a32571f,386路@e3ce166e,386路@e3ce166e","EUVTIBHZJURVWHC|辽宁奥通|107路@9c557848,107路@9c557848,112路@94192360,112路@94192360,133路@d810a85c,133路@d810a85c,168路北线@2e2b17a2,168路南线@d0229eed,168路北线@2e2b17a2,168路南线@d0229eed,169路@af7e1089,169路@af7e1089,218路@8beac754,218路@8bea

想要把中间的车站名称提取出来 例如|水晶城|

1个回答

#coding:utf-8
import re

a = u"EUVWAHSZJUSBHHC|水晶城街一汽福达|148路@2deb8f03,148路@2deb8f03,169路@af7e1089,169路@af7e1089"
b = re.compile(u"\|[\u4e00-\u9fa5]*\|")
c = b.findall(a)
for i in  c:
    print i
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!