码迷,mamicode.com
首页 > 其他好文 > 详细

cookbook-在正则中使用Unicode

时间:2020-06-03 20:17:54      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:with   import   The   bsp   port   nic   mpi   python   https   

https://python3-cookbook.readthedocs.io/zh_CN/latest/c02/p10_work_with_unicode_in_regexp.html

import re
num = re.compile(‘\d+‘)
print(num.match(‘123‘))
print(num.match(‘\u0661\u0662\u0663‘))
<_sre.SRE_Match object; span=(0, 3), match=‘123‘>
<_sre.SRE_Match object; span=(0, 3), match=‘???‘>

 

cookbook-在正则中使用Unicode

标签:with   import   The   bsp   port   nic   mpi   python   https   

原文地址:https://www.cnblogs.com/z-y-l/p/13039467.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!