Why isn't SPLIT splitting my strings

Fredrik Lundh fredrik at pythonware.com
Sun Nov 19 11:25:04 EST 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

</F>




More information about the Python-list mailing list