--- lothar <[EMAIL PROTECTED]> wrote: > how then, do i specify a non-greedy regex > <1st-pat><not-1st-pat>*?<follow-pat> > > that is, such that non-greedy part <not-1st-pat>*? > excludes a match of <1st-pat> > > in other words, how do i write regexes for my examples? Not sure if I completely understand your explanation, but does this get any closer to what your looking for?
>>> vwre = re.compile("V[^V]*?W") >>> newdoc = "V1WVVV2WWW" >>> re.findall(vwre, newdoc) ['V1W', 'V2W'] That is: <pat1>, then <not-pat1> as few times as possible, then <pat2> John Ridley Send instant messages to your online friends http://uk.messenger.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list