➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 jacques
收信人 akitada, amaury.forgeotdarc, collinwinter, ezio.melotti, georg.brandl, giampaolo.rodola, gregory.p.smith, jacques, jaylogan, jhalcrow, jimjjewett, loewis, mark, moreati, mrabarnett, nneonneo, pitrou, r.david.murray, rsc, sjmachin, timehorse, vbr
日期 2010-11-02.04:08:01
SpamBayes Score 1.7665757e-08
Marked as misclassified 否
Message-id <1288670882.84.0.0142930399135.issue2636@psf.upfronthosting.co.za>
In-reply-to
内容
Spoke too soon, although this might be a valid divergence in behavior:

$ cat test.py 
import re, regex

text = "test: 2"

print regex.sub('(test)\W+(\d+)(?:\W+(TEST)\W+(\d))?', '\\2 \\1, \\4 \\3', text)
print re.sub('(test)\W+(\d+)(?:\W+(TEST)\W+(\d))?', '\\2 \\1, \\4 \\3', text)


$ python test.py 
2 test,  
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    print re.sub('(test)\W+(\d+)(?:\W+(TEST)\W+(\d))?', '\\2 \\1, \\4 \\3', text)
  File "/usr/lib64/python2.7/re.py", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/lib64/python2.7/re.py", line 278, in filter
    return sre_parse.expand_template(template, match)
  File "/usr/lib64/python2.7/sre_parse.py", line 787, in expand_template
    raise error, "unmatched group"
sre_constants.error: unmatched group
历史
日期 用户 动作 参数
2010-11-02 04:08:02jacques修改recipients: + jacques, loewis, georg.brandl, collinwinter, gregory.p.smith, jimjjewett, sjmachin, amaury.forgeotdarc, pitrou, nneonneo, giampaolo.rodola, rsc, timehorse, mark, vbr, ezio.melotti, mrabarnett, jaylogan, akitada, moreati, r.david.murray, jhalcrow
2010-11-02 04:08:02jacques修改messageid: <1288670882.84.0.0142930399135.issue2636@psf.upfronthosting.co.za>
2010-11-02 04:08:01jacques链接issue2636 messages
2010-11-02 04:08:01jacques创建