#coding:utf-8 import re #re是正则表达式模块 def main(): str = input("请输入字符串:") chinese = re.findall('[u4e00-u9fa5]', str) # 汉字的范围为"u4e00-u9fa5" print(chinese) if __name__ == '__main__': main()
欢迎分享,转载请注明来源:内存溢出
#coding:utf-8 import re #re是正则表达式模块 def main(): str = input("请输入字符串:") chinese = re.findall('[u4e00-u9fa5]', str) # 汉字的范围为"u4e00-u9fa5" print(chinese) if __name__ == '__main__': main()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)