     index = sel.startPos.word   #position to work from
     pos = sel.startPos.pos
 
-    wordsToInsert = content.match /\w+ +/g
-    preSpaces = content.search /^ +/
+    wordsToInsert = content.match WordRegExp
+    preSpaces = content.search PreSpacesRegExp
 
     currWord = @getWord index
 

        if index == 0
          emptyWord = new Word content.substring(0, preSpaces)
          @insertWord 0, emptyWord
        else
          # update previous word
          prevWord = @getWord (index-1)
          prevWord += content.substring(0, preSpaces)
          @setWord (index-1), prevWord


  split: (n) ->
    word = @getWord n

      throw new Error "Index out of bounds"
    @_rte.words[index].word = content

  # Append new words at the end of the word list
  # @param [String] content the string to append
  push: (content) ->
    console.log '"' + content + '"'
    preSpaces = content.match PreSpacesRegExp
    if preSpaces isnt null
      @_rte.words.push(new Word (preSpaces[0]))
    words = content.match WordRegExp
    console.log '"' + preSpaces + '"'
    console.log words
    if _.isArray(words)
      for w in words
        @_rte.words.push (new Word w)

  # Insert words at position
  #
