I try to use re2.
我尝试使用re2。
import re
print re.search('cde', 'abcdefg').group(0)
Result:
结果:
cde
But re2 result is different
但是re2的结果是不同的
import re2
print re2.search('cde', 'abcdefg').group(0)
Result:
结果:
1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'group'
re2
output number 1 when every execution new string pattern?re module
(not found => return None)?The re2 version is 0.2.20. and Python is 2.7
re2版本是0.2.20。和Python是2.7
Thank you
谢谢
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2013/07/26/d42064f689b07a14a6e9de05281d66fb.html。