Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread Albert-Jan Roskam
- Original Message - > From: Steven D'Aprano > To: python-list@python.org > Cc: > Sent: Friday, July 11, 2014 11:04 AM > Subject: Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example > > On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread Steven D'Aprano
On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith wrote: > In article , > Tim Chase wrote: > >> On 2014-07-10 22:18, Roy Smith wrote: >> > > Outside this are \( and \): these are literal opening and closing >> > > bracket characters. So: >> > > >> > >\(\([^)]+\)\) >> > >> > although, even bett

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread alister
On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith wrote: > In article , > Tim Chase wrote: > >> On 2014-07-10 22:18, Roy Smith wrote: >> > > Outside this are \( and \): these are literal opening and closing >> > > bracket characters. So: >> > > >> > >\(\([^)]+\)\) >> > >> > although, even bett

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Chris Angelico
On Fri, Jul 11, 2014 at 1:33 PM, Roy Smith wrote: >> Or heck, use a multi-line verbose expression and comment it for >> clarity: >> >> r = re.compile(r""" >> (# begin a capture group >> \({2} # two literal "(" characters >> [^)]+ # one or more non-close-pare

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Roy Smith
In article , Tim Chase wrote: > On 2014-07-10 22:18, Roy Smith wrote: > > > Outside this are \( and \): these are literal opening and closing > > > bracket characters. So: > > > > > >\(\([^)]+\)\) > > > > although, even better would be to use to utterly awesome > >> re.VERBOSE > > flag, an

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Tim Chase
On 2014-07-10 22:18, Roy Smith wrote: > > Outside this are \( and \): these are literal opening and closing > > bracket characters. So: > > > >\(\([^)]+\)\) > > although, even better would be to use to utterly awesome >> re.VERBOSE > flag, and write it as: > > \({2} [^)]+ \){2} Or heck

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Roy Smith
In article , Cameron Simpson wrote: > Outside this are \( and \): these are literal opening and closing bracket > characters. So: > >\(\([^)]+\)\) > Two opening brackets, then at least one character which is not a > closing bracket, then two closing brackets. This is a

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Cameron Simpson
On 10Jul2014 08:37, fl wrote: This example is from the link: https://wiki.python.org/moin/RegularExpression I have thought about it quite a while without a clue yet. I notice that it uses double quote ", in contrast to ' which I see more often until now. With raw strings (r', r") this doesn'

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Albert-Jan Roskam
- Original Message - > From: Joel Goldstick > To: fl > Cc: "python-list@python.org" > Sent: Thursday, July 10, 2014 7:05 PM > Subject: Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example > > On Thu, Jul 10, 2014 at 11:37 AM, f

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Joel Goldstick
On Thu, Jul 10, 2014 at 11:37 AM, fl wrote: > Hi, > > This example is from the link: > > https://wiki.python.org/moin/RegularExpression > > > I have thought about it quite a while without a clue yet. I notice that it > uses > double quote ", in contrast to ' which I see more often until now. Dou

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread MRAB
On 2014-07-10 16:37, fl wrote: Hi, This example is from the link: https://wiki.python.org/moin/RegularExpression I have thought about it quite a while without a clue yet. I notice that it uses double quote ", in contrast to ' which I see more often until now. It looks very complicated to me.

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread Peter Otten
fl wrote: > Hi, > > This example is from the link: > > https://wiki.python.org/moin/RegularExpression > > > I have thought about it quite a while without a clue yet. I notice that it > uses double quote ", in contrast to ' which I see more often until now. > It looks very complicated to me. Co

How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-10 Thread fl
Hi, This example is from the link: https://wiki.python.org/moin/RegularExpression I have thought about it quite a while without a clue yet. I notice that it uses double quote ", in contrast to ' which I see more often until now. It looks very complicated to me. Could you simplified it to a simp