Woops! Thanks for the correction. I was assuming greediness for some
reason.

Fredrik Lundh wrote:
> Dylan Moreland wrote:
>
> > So I would try something like:
> >
> > pat = re.compile(r" (?:AND|OR|AND NOT) ")
> > pat.split(string)
>
> footnote: this yields:
>
>     ['Smith, R.', 'White', 'Blue, T.', 'Black', 'Red', 'NOT Green']
>
> (the | operator picks the first (leftmost) alternative that results in an
> overall match.)
> 
> </F>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to