On Jul 2, 4:49 am, kj <no.em...@please.post> wrote: > In <xns9c3bca27abc36duncanbo...@127.0.0.1> Duncan Booth > <duncan.bo...@invalid.invalid> writes: > > >So, for example: > >>>> re.compile("c").match("abcdef", 2) > ><_sre.SRE_Match object at 0x0000000002C09B90> > >>>> re.compile("^c").search("abcdef", 2) > > I find this unconvincing; with re.search alone one could simply > do: > > >>> re.compile("^c").search("abcdef"[2:])
given large enough values of "abcdef", you just allocated several megs for no good reason, when re.compile("c").match("abcdef", 2) would process "abcdef" in-place. -- http://mail.python.org/mailman/listinfo/python-list