[issue2636] Regexp 2.7 (modifications to current re 2.2.2)
Bobby Xiao nneon...@gmail.com added the comment: I'm glad to see that the unmatched group issue is finally being addressed. Thanks! -- nosy: +nneonneo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2636 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue - workaround
Bobby Xiao nneon...@gmail.com added the comment: It was so long ago, I've since redone half my codebase (the hack is still there, but I can't remember what it was meant to replace now :( ). Sorry about that. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1519638 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue - workaround
Bobby Xiao nneon...@gmail.com added the comment: Well, in this example the group (ar) is unmatched, so sre throws the error, and because of the alternation, the workaround you mentioned doesn't seem to directly apply. A better example is probably re.sub(foo(?:b(ar)|foo),\\1,foofoo) because this can't be simply repaired by refactoring the regex. The correct behaviour, as I have observed in other regex implementations, is to replace the group by the empty string; for example, in Javascript: 'foobar'.replace(/foo(?:b(ar)|baz)/,'$1') ar 'foobaz'.replace(/foo(?:b(ar)|baz)/,'$1') -- versions: +Python 2.5, Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1519638 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1519638] Unmatched Group issue - workaround
Bobby Xiao nneon...@gmail.com added the comment: How would I apply that workaround to my example? re.sub(foo(?:b(ar)|baz),\\1,foobaz) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1519638 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4526] Clarify documentation for binary literals
New submission from Bobby Xiao [EMAIL PROTECTED]: Under http://docs.python.org/dev/3.0/whatsnew/3.0.html#new-syntax, on the last two points, it says # New binary literals, e.g. 0b1010 (already in 2.6). # Bytes literals are introduced with a leading b or B, and there is a new corresponding builtin function, bin(). I believe it should read # New binary literals, e.g. 0b1010 (already in 2.6), and there is a new corresponding builtin function, bin(). # Bytes literals are introduced with a leading b or B, and there is a new corresponding builtin function, bytes(). or something along those lines, as bin is for binary literals, not bytes literals, and bytes is for bytes literals. -- assignee: georg.brandl components: Documentation messages: 76897 nosy: georg.brandl, nneonneo severity: normal status: open title: Clarify documentation for binary literals versions: Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4526 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com