template strings for matching?

skip at pobox.com skip at pobox.com
Thu Oct 9 08:59:17 EDT 2008


    Joe>   templ = Template("The $object in $location falls mainly in the  $subloc.")
    Joe>   d = templ.match(s)

    Joe> and then d would either by None (if s doesn't match), or a
    Joe> dictionary with values for 'object', 'location', and 'subloc'.

    Joe> But I couldn't find anything like that in the docs.  Am I
    Joe> overlooking something?

Nope, you're not missing anything.

Skip



More information about the Python-list mailing list