Reputation: 702
So, I am using QSyntaxHiglihter
to create syntax highlight rules for my editor. I am using QRegExp
for this purpose. Now, regular expressions is not my field, so anybody know how to create a rule for say,
std::cout
with std one color, and cout another? I tried with QRegExp("\\b::\\b");
, but that only colors the colons. Thanks!
Figured it out: \\b[A-Za-z0-9_]+(?=::)
Upvotes: 1
Views: 110
Reputation: 11832
You can not solve your problem without a basic understanding of regular expressions. The documentation of QRegExp contains a brief introduction. If I were you I would read it and the Syntax Highlighter Example. These two articles will help you find the answer to your questions.
Upvotes: 1