>> Also, what made the expression greedy?
> 
> They usually are, by default.  It means that when there
> are more than one ways to match the pattern, choose the
> one that matches the most text.  Often there are flags
> available to change that behavior.  I'm not sure off hand
> how to do it with the re module.

In python's RE module, they're like Perl:

Greedy:  "<.*>"
Nongreedy:  "<.*?>"

By appending a question-mark onto the operator, one makes it a 
non-greedy repeat.  It also applies to the plus ("one or more") 
and the questionmark ("zero or one")

-tkc




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

Reply via email to