code: def get_word_under_cursor(self):
          
  
          if not re.match(r"^\w+$", foundations.strings.to_string(self.get_previous_character())):
              return QString()
  
          cursor = self.textCursor()
          cursor.movePosition(QTextCursor.PreviousWord, QTextCursor.MoveAnchor)
          cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor)
          return cursor.selectedText()
docs: Returns the document word under cursor.
  
          :return: Word under cursor.
          :rtype: QString