QtWidgets.QTextEdit.textCursor().movePosition(); how to define the exact number of characters?

A method to find a substring and highlight it in QTextEdit has already been proposed in stackoverflow by vicent.
This is an elegant and effective method. However as it is used:
cursor.movePosition(QtGui.QTextCursor.EndOfWord, 1)

the highl…