In article <9170aad0-478a-4222-b6e2-88d00899d...@t2g2000yqe.googlegroups.com>, naugiedoggie <michael.a.p...@gmail.com> wrote:
> Hello, > > I'm having a problem with using a function as the replacement in > re.sub(). > > Here is the function: > > def normalize(s) : > return > urllib.quote(string.capwords(urllib.unquote(s.group('provider')))) I read though this entire post, and I'm not quite sure what you're asking. May I suggest that you need to break this down into smaller pieces and find a minimal test case. I'm guessing this is a problem with the regex processing. To prove that, strip away everything else and verify that part in isolation. Compile your regex, and match it against a string that you expect it to match. Then, examine the groups returned by the match object. If they're not what you expect, then re-post your question, with just this minimal test code. -- http://mail.python.org/mailman/listinfo/python-list