Skip to content

Recursive regular expressions #38067

Closed
Closed

Description

@kamek
mannequin
BPO 694374
Nosy @rhettinger, @bitdancer

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 = <Date 2013-02-24.00:50:41.292>
created_at = <Date 2003-02-27.14:00:02.000>
labels = ['expert-regex', 'type-feature']
title = 'Recursive regular expressions'
updated_at = <Date 2013-02-24.02:52:36.822>
user = 'https://bugs.python.org/kamek'

bugs.python.org fields:

activity = <Date 2013-02-24.02:52:36.822>
actor = 'mrabarnett'
assignee = 'none'
closed = True
closed_date = <Date 2013-02-24.00:50:41.292>
closer = 'r.david.murray'
components = ['Regular Expressions']
creation = <Date 2003-02-27.14:00:02.000>
creator = 'kamek'
dependencies = []
files = []
hgrepos = []
issue_num = 694374
keywords = []
message_count = 10.0
messages = ['53789', '53790', '74105', '74687', '74689', '84087', '84091', '114221', '182843', '182848']
nosy_count = 8.0
nosy_names = ['rhettinger', 'niemeyer', 'kamek', 'timehorse', 'mrabarnett', 'r.david.murray', 'pwaller', 'BreamoreBoy']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue694374'
versions = ['Python 2.7']

Activity

  1. kamek commented on Feb 27, 2003

    kamekmannequin
    MannequinAuthor

    It would be great if Python's regexps supported recursive
    regular expressions, just like PCRE. For that it'd need
    its formations (?R), (?<name>) and (?P>name).

  2. rhettinger commented on Jun 28, 2003

    @rhettinger
    Contributor

    Logged In: YES
    user_id=80475

    This might be a worthwhile addition to Py2.4.

  3. mrabarnett commented on Sep 30, 2008

    mrabarnettmannequin
    Mannequin

    I'll have a look at this. No promises, though.

  4. timehorse commented on Oct 13, 2008

    timehorsemannequin
    Mannequin

    The PCRE has some interesting suggestions on how the grammar for a
    recursive regular expressions might work. I am concerned about the use of
    (?P>name) to call a regexp subexpression as an atomic subroutine. The (?
    P>name) format has never before been supported by Python and the (?P...)
    notation is exclusive to python, so it is strange the PCRE assigning us a
    use for (?P>name) without the Python community actually agreeing to it.
    Other than that, though, I think this is a possible feature we could add
    in bpo-2636 as item 35.

  5. mrabarnett commented on Oct 13, 2008

    mrabarnettmannequin
    Mannequin

    Perl (?number) for calling numbered groups and (?&name) for named groups
    (Perl also supports (?P>name)). (?R) is equivalent to (?0).

    It's interesting that the documentation for both Perl and PCRE say that
    they support (?P>name) because that's what Python uses!

  6. pwaller commented on Mar 24, 2009

    pwallermannequin
    Mannequin

    It looks like Matthew has dropped this feature from consideration.

    See msg83993 .

  7. mrabarnett commented on Mar 24, 2009

    mrabarnettmannequin
    Mannequin

    There are 2 reasons:

    1. I've been told that my current patches contain too many differences
      from the current implementation, so basically I have to go back to the
      start and introduce any changes a little at a time, without knowing
      whether any particular change will be accepted.

    2. I think that recursive regular expressions are starting to stray into
      the realm of pyparsing and so forth.

    So I might not have the time (and I don't think I have the inclination!)
    to implement them.

  8. BreamoreBoy commented on Aug 18, 2010

    BreamoreBoymannequin
    Mannequin

    Closing because of quote from msg83993 "Another feature request that I've decided not to consider any further is recursive regular expressions. There are other tools available for that kind of thing, and I don't want the re module to go the way of Perl 6's rules; such things belong elsewhere, IMHO."

  9. bitdancer commented on Feb 24, 2013

    @bitdancer
    Member

    Agreed that this is unlikely to ever get implemented given that Matthew doesn't think it should be.

  10. mrabarnett commented on Feb 24, 2013

    mrabarnettmannequin
    Mannequin

    FYI, I did eventually add it to my regex implementation. It was quite challenging!

  11. transferred this issue fromon Apr 9, 2022
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions