diff --git a/src/utils.py b/src/utils.py index cc05b880b..b5e1a82ce 100755 --- a/src/utils.py +++ b/src/utils.py @@ -214,16 +214,33 @@ def quoted(s): """Returns a quoted s.""" return '"%s"' % s -nonEscapedSlashes = re.compile(r'(?= 2 + if s.startswith('m') or s.startswith('s'): + separator = s[1] + else: + separator = s[0] + if separator.isalnum() or separator in '{}[]()<>': + raise ValueError, \ + 'Invalid separator: separator must not be alphanumeric or in ' \ + '"{}[]()<>"' + return separator + +def _getSplitterRe(s): + separator = _getSep(s) + return re.compile(r'(?