[issue21002] _sre.SRE_Scanner object should have a fullmatch() method
New submission from Gareth Gouldstone: I believe that the SRE_Scanner object should have a .fullmatch() method for consistency with other re pattern-matching behaviour. >>> rex = re.compile('([^\\W\\d_]{1,2}[0-9]{1,2}[^\\d\\W_]?)[ >>> \\t]*([0-9][^\\d\\W_]{2})') >>> rex.scanner('bn20bs') <_sre.SRE_Scanner object at 0x102006400> >>> rex.scanner('bn20bs').search() <_sre.SRE_Match object; span=(0, 6), match='bn20bs'> >>> rex.scanner('bn20bs').match() <_sre.SRE_Match object; span=(0, 6), match='bn20bs'> >>> rex.scanner('bn20bs').fullmatch() >>> Traceback (most recent call last): File "", line 1, in AttributeError: '_sre.SRE_Scanner' object has no attribute 'fullmatch' -- components: Regular Expressions messages: 214317 nosy: Gareth.Gouldstone, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: _sre.SRE_Scanner object should have a fullmatch() method type: behavior versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue21002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21002] _sre.SRE_Scanner object should have a fullmatch() method
Gareth Gouldstone added the comment: I also encountered issue 20998, which explains the convoluted [^\W\d_] in place of [a-zA-Z] as I was investigating why case-insensitivity and quantifiers would not work together. -- ___ Python tracker <http://bugs.python.org/issue21002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21002] _sre.SRE_Scanner object should have a fullmatch() method
Gareth Gouldstone added the comment: Scanner may not be a public interface but it is widely documented, not least on page 67 of the O'reilly Python Cookbook. Even if Scanner is not made public, then surely it should maintain consistency with the public interfaces? -- versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issue21002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20998] fullmatch isn't matching correctly under re.IGNORECASE
Gareth Gouldstone added the comment: fullmatch() is not yet implemented on the regex scanner object SRE_Scanner (issue 21002). Is it possible to adapt this patch to fix this omission? -- nosy: +Gareth.Gouldstone ___ Python tracker <http://bugs.python.org/issue20998> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com