PDA

View Full Version : Help on QRegExp



dmr
20th December 2012, 14:34
Hello! I've a problem. I'm making a c++ syntax highlighter for use it on QPlainTextEdit. I've already the keywords, the basic types the numbers and the preprocessor directives, but I'm not able to highlight the chars in the way 'c'.
I trying a lot of ways to code the regular expression but only I achieve something like this using
QRegExp("\\b'.'\\b") : 'a'a'a'a'c'g'g'{'{'{''{'/'/'/'9'999'34'
is the regexp correct? I want to highlight both chars and quote (i.e. char a = 'L', b = '{').

Sorry for my poor English and thanks in advance.

amleto
20th December 2012, 14:53
QRegExp("'.'")
If you cant see clearly, it is "double-quote, apostrophe, period, apostrophe, double-quote"

http://regexpal.com/

dmr
20th December 2012, 15:03
Thanks amleto!!! it works fine. And the link will be very useful for my in the future :)