Fredrik Lundh wrote: > John Henry wrote: > > > Oops! > > for cases like this, writing > > "[" + re.escape(charset) + "]" >
So, like this? newString= re.split("[" + re.escape("; ()[]") + "]", result) > is usually a good way to avoid repeated oops:ing. > > > newString= re.split("[; ()\[\]", result) > > >>> newString= re.split("[; ()\[\]", result) > Traceback (most recent call last): > ... > sre_constants.error: unexpected end of regular expression > Strange. It works for me. Oh, I know, it's missing a "]". newString= re.split("[; ()\[\]]", result) > </F> -- http://mail.python.org/mailman/listinfo/python-list