On Sep 9, 12:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:

>
> you may also want to do re.escape on all the words, to avoid surprises
> when the choices contain special characters.

yes, thank you very much:

import re

def oneOf(s):
    alts = sorted(s.split(), reverse=True)
    alts = [re.escape(s) for s in alts]
    return "|".join(alts)

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

Reply via email to