X-Received: by 10.66.161.234 with SMTP id xv10mr24678082pab.20.1405006638502; Thu, 10 Jul 2014 08:37:18 -0700 (PDT) X-Received: by 10.182.153.200 with SMTP id vi8mr71222obb.23.1405006638303; Thu, 10 Jul 2014 08:37:18 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!hn18no247317igb.0!news-out.google.com!gf2ni6igb.0!nntp.google.com!r10no643862igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Thu, 10 Jul 2014 08:37:18 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=64.229.140.25; posting-account=SZ_svQkAAACWRFG2bDA-zgq8ILyl4-vo NNTP-Posting-Host: 64.229.140.25 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <981c1f5f-2c19-4efc-8397-796bde07f39b@googlegroups.com> Subject: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example From: fl Injection-Date: Thu, 10 Jul 2014 15:37:18 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:74312 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 simple example? Thanks, import re split_up = re.split(r"(\(\([^)]+\)\))", "This is a ((test)) of the ((emergency broadcasting station.))") ...which produces: ["This is a ", "((test))", " of the ", "((emergency broadcasting station.))" ]