Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support the 'groupindex' attribute on compiled patterns #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 25, 2015

  1. support the 'groupindex' attribute on compiled patterns

    The python 're' module has a 'groupindex' attribute on compiled
    patterns. The re2 library also supports as much through
    RE2::NamedCapturingGroups(), however prior to this patch it wasn't
    exposed through pyre2.
    
    For example:
    
        >>> import re, re2
        >>> re.compile("(?P<foo>aaa)(?P<bar>bbb)").groupindex
        {'foo': 1, 'bar': 2}
        >>> re2.compile("(?P<foo>aaa)(?P<bar>bbb)").groupindex
        {'foo': 1, 'bar': 2}
    srp committed Nov 25, 2015
    Configuration menu
    Copy the full SHA
    a01adc0 View commit details
    Browse the repository at this point in the history