1 2 3 4 5 6 |
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> a='1'*100000 >>> len(re.findall('\d+',a)[0]) 65535 |
簡直sad
python3中這個bug被修正了 [141011]2.7.8中也已無此bug
1 2 3 4 5 6 |
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> a='1'*100000 >>> len(re.findall('\d+',a)[0]) 100000 |
然後嘗試
1 2 3 4 |
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]on win 32 >>> import sre_constants >>> sre_constants.MAXREPEAT 65535 |
以及
1 2 3 4 |
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit (Intel)] on win32 >>> import sre_constants >>> sre_constants.MAXREPEAT 2147483647 |
整(full)個(a)人(person)都(all)不(not)好(good)了(le)