1. if you have editor then you should use QTextDocument::find-4
2. in regular expression there is assertion "\b" which means word boundary (you don't have to use space or other character to detect that), see QRegExp documentation.
example: QRegExp("\\b\\w+\\b");
3. check qt examples there is something similar to your problem.
Bookmarks