On Thu, 12 Jun 2008 05:12:55 -0700 (PDT), John Machin <[EMAIL PROTECTED]> wrote:
>On Jun 12, 8:57 pm, David C. Ullrich <[EMAIL PROTECTED]> wrote: >> True or False? (no fair looking it up) >> >> (*) If repl is a string then re.sub(pattern, repl, s) >> returns s with non-overlapping occurences of pattern >> replaced by repl. >> >> I assumed it was true - spent a few hours trying to >> figure out what was going on with a certain re.sub, >> then noticed that (*) is false: >> > >Well, the docs do say "Return the string obtained by replacing the >leftmost non-overlapping occurrences of pattern in string by the >replacement repl." That's the _first sentence_, yes. I _quoted_ another sentence (from an old version, istr it phrased slightly differently in recent versions) in my post. > -- care to tell us what "a certain re.sub" is, and >false in what way? Read the OP. David C. Ullrich -- http://mail.python.org/mailman/listinfo/python-list