Is there a reverse operator to the '%' operator on string ?
Hamish Lawson
hamish_lawson at yahoo.co.uk
Thu Feb 14 10:13:22 EST 2002
Boris Boutillier wrote:
> Now what I'd like to do is revert the '%' operator ... something
> like the 'scanf' C function
The usual way of doing this is with regular-expression matching. They
are a bit more verbose than scanf's patterns, but more general.
Employing named groups in your RE should give you the dictionary of
results that you are looking for.
Hamish Lawson
More information about the Python-list
mailing list