>>> re.split(r ' [+\-*/%] ' , ' +a-b-c ' ) [ '' , ' a ' , ' b ' , ' c ' ]

>>> re.split(r ' [+-*/%] ' , ' +a-b-c ' ) Traceback (most recent call last): File " <pyshell#15> " , line 1, in <module> re.split(r ' [+-*/%] ' , ' +a-b-c ' ) File " C:\Python27\lib\re.py " , line 167, in split return _compile(pattern, flags).split(string, maxsplit) File " C:\Python27\lib\re.py " , line 242, in _compile raise error, v # invalid expression error: bad character range