In *this* case I'd cobble together whatever the eventual string was in some other way entirely rather than trying to do a regexp substitution into a pattern. snprintf in C or % in Python, for instance. And that's assuming that a string is the right answer; if the aim is to synthesize a command to be executed then in many interfaces you wanted some kind of list, so you don't have to worry about shell quoting rules.
no subject
Date: 2007-04-02 12:13 pm (UTC)