Revision 100 as of 2008-09-05 19:05:41

Clear message

See Also: ["Asking for Help/Why doesn`t this work?"]

No, it is doing what you told it to do. To realize this you must know that arguments are evaluated before they are passed to the functions. But what is the value of "\g<1>".replace(",", "|")? "\g<1>", of course, as there are no commas to replace in "\g<1>". re.sub therefore receives '"([^"]*)"' and "\g<1>" as arguments, which is the exact equivalent of the first call.

Answered (fully or partially)


CategoryFaq

Unable to edit the page? See the FrontPage for instructions.