Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 276557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:56:19+00:00 2026-05-12T00:56:19+00:00

I seem to remember that Regular Expressions in DotNet have a special mechanism that

  • 0

I seem to remember that Regular Expressions in DotNet have a special mechanism that allows for the correct matching of nested structures, like the grouping in “( (a ( ( c ) b ) ) ( d ) e )“.

What is the python equivalent of this feature? Can this be achieved using regular expressions with some workaround? (Though it seems to be the sort of problem that current implementations of regex aren’t designed for)

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:56:20+00:00Added an answer on May 12, 2026 at 12:56 am

    You can’t do this generally using Python regular expressions. (.NET regular expressions have been extended with “balancing groups” which is what allows nested matches.)

    However, PyParsing is a very nice package for this type of thing:

    from pyparsing import nestedExpr
    
    data = "( (a ( ( c ) b ) ) ( d ) e )"
    print nestedExpr().parseString(data).asList()
    

    The output is:

    [[['a', [['c'], 'b']], ['d'], 'e']]
    

    More on PyParsing:

    • http://pyparsing.wikispaces.com/Documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I seem to have found a bug in jQuery UI that duplicates dragged elements
I seem to remember that there is a command to look at a mysql
I have a basic question that I can't seem to resolve using Google (Or
I seem to remember a tool that could be used at runtime to tell
I seem to remember reading somewhere that google app engine automatically caches the results
In .net 1.1 I seem to remember I had to declare web controls that
I seem to remember that in PHP there is a way to pass an
document.getElementById(displayImage).getElementsByTagName(img)[0].src = image2.png I seem to remember that for IE, you need to add
I seem to remember sometime back reading that changing the appearance of the mail
I seem to remember that ANSI C didn't specify what value should be returned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.