Why isn't SPLIT splitting my strings

Fredrik Lundh fredrik at pythonware.com
Sun Nov 19 17:25:04 CET 2006

John Henry wrote:

> Oops!

for cases like this, writing

	"[" + re.escape(charset) + "]"

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


More information about the Python-list mailing list