Visitar URL original
SRE: Atomic Grouping (?>...) is not supported · Issue #34627 · python/cpython · GitHub
Skip to content

SRE: Atomic Grouping (?>...) is not supported #34627

Description

@effbot
mannequin
BPO 433030
Nosy @birkenfeld, @terryjreedy, @ezio-melotti, @serhiy-storchaka
PRs
  • bpo-433030: Add support of atomic grouping in regular expressions #31982
  • Files
  • issue2636-01.patch
  • re_atomic_groups.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2001-06-14.08:30:56.000>
    labels = ['expert-regex', 'type-feature', 'library', '3.11']
    title = 'SRE: Atomic Grouping (?>...) is not supported'
    updated_at = <Date 2022-03-21.16:28:37.831>
    user = 'https://bugs.python.org/effbot'

    bugs.python.org fields:

    activity = <Date 2022-03-21.16:28:37.831>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Regular Expressions']
    creation = <Date 2001-06-14.08:30:56.000>
    creator = 'effbot'
    dependencies = []
    files = ['10646', '37182']
    hgrepos = []
    issue_num = 433030
    keywords = ['patch']
    message_count = 12.0
    messages = ['53164', '63284', '63288', '64634', '64735', '65777', '68337', '113201', '114621', '231041', '231049', '415685']
    nosy_count = 10.0
    nosy_names = ['effbot', 'georg.brandl', 'terry.reedy', 'rsc', 'timehorse', 'ezio.melotti', 'mrabarnett', 'THRlWiTi', 'abacabadabacaba', 'serhiy.storchaka']
    pr_nums = ['31982']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue433030'
    versions = ['Python 3.11']

    Activity

    1. effbot commented on Jun 14, 2001

      effbotmannequin
      MannequinAuthor

      from the jeffrey friedl report:

      (?>...) is not supported

      [this is a "stand-alone pattern". the engine has code
      for this, but the parser doesn't recognize this yet.
      shouldn't be too hard to fix; I just need a couple of
      good test cases before I start /F]

    2. self-assigned this
      on Jun 14, 2001
    3. self-assigned this
      on Jun 14, 2001
    4. akuchling commented on Mar 5, 2008

      @akuchling
      Contributor

      Also referred to as an atomic group: see
      http://www.regular-expressions.info/atomic.html for a discussion.

      Fredrik, when you say "the engine has code for this", what do you mean?

    5. akuchling commented on Mar 5, 2008

      @akuchling
      Contributor

      There's also an alternate syntax for this, called possessive
      quantifiers: a*+, a++, a{m,n}+.

    6. timehorse commented on Mar 28, 2008

      timehorsemannequin
      Mannequin

      Fredrik,

      If you're still listening, I am gonna try and tackle this one but I
      would like to know why you or the famous Jeffrey of the Regexp world
      claims that there is already code in the Regexp Engine for Atomic
      Grouping? Adding a hook for (?>...) should be trivial but I don't wanna
      re-invent the wheel if the proper stack-unwind code already exists.
      Thanks. Of course, Andrew (a.k.a. A.M. Kuchling) already asked this
      question and you did not answer it, so I guess you're not reading this,
      but if you are, please respond. Thanks!

    7. changed the title [-]SRE: (?>...) is not supported[/-] [+]SRE: Atomic Grouping (?>...) is not supported[/+] on Mar 28, 2008
    8. changed the title [-]SRE: (?>...) is not supported[/-] [+]SRE: Atomic Grouping (?>...) is not supported[/+] on Mar 28, 2008
    9. timehorse commented on Mar 29, 2008

      timehorsemannequin
      Mannequin

      I'm digging into the sre_parse.py at the moment and this I have all the
      changes I need for that now. The rest of the changes I believe are in
      either sre_compile.py or more likely directly in _sre.c, so I will
      examine those files next. I am attaching a single diff for
      expedience. This is not an official patch, just a sample to see the
      progress I am making. I forgot the correct format for patch files but
      I promise to get it right when I have made more progress.

    10. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Mar 29, 2008
    11. 4 remaining items

    12. serhiy-storchaka commented on Nov 11, 2014

      @serhiy-storchaka
      Member

      Some unrelated to the topic changes from the patch are committed in 30a6c74ad87f.

    13. serhiy-storchaka commented on Nov 11, 2014

      @serhiy-storchaka
      Member

      Reopened because definitely regex will be not adopted in 3.5.

      Here is updated to 3.5 Jeffrey's patch.

    14. serhiy-storchaka commented on Mar 21, 2022

      @serhiy-storchaka
      Member

      New changeset 345b390 by Serhiy Storchaka in branch 'main':
      bpo-433030: Add support of atomic grouping in regular expressions (GH-31982)
      345b390

    15. transferred this issue fromon Apr 9, 2022
    16. hugovk commented on Apr 11, 2022

      @hugovk
      Member

      Closing because GH-31982 has been merged.

    17. gpshead commented on Jul 26, 2023

      @gpshead
      Member

      This feature addition led to #106052

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-regextype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions