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

Albert-Jan Roskam fomcl at yahoo.com
Thu Jul 10 21:15:16 CEST 2014



----- Original Message -----

> From: Joel Goldstick <joel.goldstick at gmail.com>
> To: fl <rxjwg98 at gmail.com>
> Cc: "python-list at python.org" <python-list at 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, fl <rxjwg98 at gmail.com> 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.
> 
> Double quotes or single quotes -- doesn't matter.
> 
>>  It looks very complicated to me. Could you simplified it to a simple 
> example?
>> 
> You might read up first here: https://docs.python.org/2/library/re.html
> 
> If you are just new to learning python, regular expressions are not a
> good place to start.  But if you insist, the page you are looking at
> is more of a cheat sheet .

The free sample chapter from Mark Summerfield's book is about regular expressions:
http://www.informit.com/content/images/9780321680563/samplepages/0321680561_Sample.pdf
That whole book is superb, and the regex chapter is no exception.



More information about the Python-list mailing list