<div class="gmail_quote">2009/3/24 Tino Wildenhain <span dir="ltr"><<a href="mailto:tino@living-examples.com">tino@living-examples.com</a>></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
The simple {foo} expansion you mention should be quite easily handled<br>
with re.sub and a function as argument. So not much more then a few<br>
lines of code.</blockquote><div><br>Could this approach be made to handle recursive expansion? From the example with the script:<br><br>pprint(BraceExpand("electron_{n,{pt,eta,phi}[{1,2}]}", ordering = [True]))<br>
<br>Gives:<br><br>['electron_n',<br> 'electron_pt[1]',<br> 'electron_eta[1]',<br> 'electron_phi[1]',<br> 'electron_pt[2]',<br> 'electron_eta[2]',<br> 'electron_phi[2]']<br>
<br>Cheers,<br><br>- Pete<br></div></div><br>