Results 1 to 2 of 2

Thread: Extract method on plaintext with QRegExp

  1. #1
    Join Date
    Jan 2006
    Posts
    156
    Thanked 12 Times in 12 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Extract method on plaintext with QRegExp

    Hello,

    With QRegExp, I want to extract each method names on QString returned by plaintext() method on QTextEdit, i.e. words between :: and ) but not on "" or () or {}

    Qt Code:
    1. void class::method(myEnum::foo f)
    2. {
    3. QString s = QString::number(5);
    4. }
    To copy to clipboard, switch view to plain text mode 
    must return method(myEnum::foo f) but not foo nor QString::number(5)

    Thanks
    Last edited by jlbrd; 2nd July 2006 at 10:34.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Extract method on plaintext with QRegExp

    Maybe something like this:
    Qt Code:
    1. "::(\\w+\\([\\w\\s:]*\\))\\s*(?:const)?\\s*\\{"
    To copy to clipboard, switch view to plain text mode 

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.