[issue11198] re sub subn backreferrence too few replacements

2011-02-12 Thread muxum
muxum added the comment: aww ic -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue11198] re sub subn backreferrence too few replacements

2011-02-11 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue11198] re sub subn backreferrence too few replacements

2011-02-11 Thread Matthew Barnett
Matthew Barnett added the comment: Argument 4 of re.subn(...) is 'count', the maximum number of replacements to perform, but you're passing in the MULTILINE flag, which happens to have the integer value 8, hence you're limiting the maximum number of replacements to 8. --

[issue11198] re sub subn backreferrence too few replacements

2011-02-11 Thread R. David Murray
Changes by R. David Murray : -- nosy: +mrabarnett ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue11198] re sub subn backreferrence too few replacements

2011-02-11 Thread muxum
New submission from muxum : #download/try this: http://ideone.com/QA6Fg from re import * s = 'a->b\na->b\nc->b\nc->b\na->d\na->d\ne->b\ne->b\na->f\na->f\ng->b\ng->b\na->h\na->h\ni->b\ni->b\na->j\na->j\nk->b\nk->b\n' res = subn(r"(.*\n)(\1)+",r"replaced:\1",s,M) print("output: " + res[0]) pr