zhzhang
import re

comments ="abc大家好,浙江省,杭州市,西溪湿地"
pattern = re.compile(r\'[\u4e00-\u9fa5]+\')
filterdata = re.findall(pattern, comments)
print(filterdata)
# [\'大家好\', \'浙江省\', \'杭州市\', \'西溪湿地\']
# 连接所有中文 
resultdata = \'\'.join(filterdata)
print(resultdata)
# 大家好浙江省杭州市西溪湿地

 

取出文档中的中文

 

待续。。。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-12-13
  • 2022-12-23
  • 2021-05-31
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2021-06-11
  • 2021-07-23
  • 2021-09-07
  • 2021-07-28
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案