code: def _separate_words(string):
      words = []
      separator = ""
      i = 1
      s = 0
      p = string[0:1]
      was_upper = False
      if string.isupper():
          string = string.lower()
          was_upper = True
      while i <= len(string):
          c = string[i:i + 1]
          split = False
          if i < len(string):
              if UPPER.match(c):
                  split = True
              elif NOTSEP.match(c) and SEP.match(p):
                  split = True
              elif SEP.match(c) and NOTSEP.match(p):
                  split = True
          else:
              split = True
          if split:
              if NOTSEP.match(p):
                  words.append(string[s:i])
              else:
                  if not separator:
                      separator = string[s:s + 1]
                  words.append(None)
              s = i
          i += 1
          p = c
      return words, separator, was_upper