[Tutor] Simply Regular Expression or Matching question ?

Bob Gailer ramrom@earthling.net
Sat Jan 18 09:09:01 2003


--=======44751008=======
Content-Type: text/plain; x-avg-checked=avg-ok-B74577E; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

At 12:36 AM 1/19/2003 +1300, Graeme Andrew wrote:
>parse code that includes some delimited text in the form {abcd ...} .
>
>Is there a simple 're' that will return all occurences of the text between
>the curly brackets as descibed above

 >>> import re
 >>> s = 'a{b}\nc{d}'
 >>> re.findall(r'{.*}', s)
['{b}', '{d}']

Bob Gailer
mailto:ramrom@earthling.net
303 442 2625

--=======44751008=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-B74577E
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 1/7/2003

--=======44751008=======--