Barry Warsaw wrote:
> On Apr 4, 2006, at 7:17 PM, Ian Bicking wrote:
>> These don't quite work with string.Template, because ${...} has the 
>> same content constraints that $... has, so you can't easily put 
>> extended expressions in there.  I could have sworn I opened an SF bug 
>> on this, but it appears not.  But that's an aside.
>>
> 
> I may be misunderstanding, but the contents of ${...} is pretty flexible 
> because you control the regular expression that matches the 
> substitution.  Heck, you can even use something other than $ delimiters 
> if you want.

The problem is that the regex for the ... in $... and ${...} is the 
same, so if you want to match ${foo:bar}, you also have to match 
$foo:bar.  I'd rather leave $foo constrained to simple variable names, 
and require ${} for anything more complex.

I got around that with LaxTemplate at the bottom of this file: 
http://svn.pythonpaste.org/Paste/Script/trunk/paste/script/copydir.py


-- 
Ian Bicking  |  [EMAIL PROTECTED]  |  http://blog.ianbicking.org
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to