Results 1 to 3 of 3

Thread: Help on QRegExp

  1. #1
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Help on QRegExp

    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
    Qt Code:
    1. QRegExp("\\b'.'\\b")
    To copy to clipboard, switch view to plain text mode 
    : '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.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help on QRegExp

    Qt Code:
    1. QRegExp("'.'")
    To copy to clipboard, switch view to plain text mode 
    If you cant see clearly, it is "double-quote, apostrophe, period, apostrophe, double-quote"

    http://regexpal.com/
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. The following user says thank you to amleto for this useful post:

    dmr (20th December 2012)

  4. #3
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Help on QRegExp

    Thanks amleto!!! it works fine. And the link will be very useful for my in the future

Similar Threads

  1. Please help on QRegExp
    By lni in forum Qt Programming
    Replies: 6
    Last Post: 25th September 2011, 07:42
  2. help on qregexp
    By sanqt in forum Newbie
    Replies: 1
    Last Post: 20th February 2011, 16:39
  3. Help on QRegExp please
    By lni in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2010, 06:57
  4. QRegExp
    By tebessum in forum Qt Programming
    Replies: 1
    Last Post: 3rd August 2008, 18:44
  5. QRegExp help
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 8th February 2008, 10:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.