Malcolm Greene wrote:
> Suggestions on the best way to extract delimited substrings strings from
> a larger string?
> 
> Background: I have a long multi-line string with expressions delimited
> with '<(' and ')>' markers. I would like to extract these substrings and
> process them in a loop.

> What strategy would you recommend?

If you just want to get the text between <( and )>, re.findall() or 
re.finditer() is probably the simplest way to do it. If it is more 
complicated than that (e.g. nesting, escape chars) then I would probably 
look at pyparsing.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to