Results 1 to 3 of 3

Thread: RegExp

  1. #1
    Join Date
    Nov 2009
    Location
    Argentina
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question RegExp

    Hi,
    I'm new to QRegExp, and I've been reading the QRegExp documentation, but I can't get to this:
    I want a regular expression to match a string preceded by a word. For example, I have font-family="Tahoma";. I want to match JUST the font name ("Tahoma"), like it is in red.
    I don't want to match the font-family, but it has to be before the font name.
    Does somebody understand me?

    P.D: I'm sorry about my poor English, I'm Argentinian.
    Thanks in advanced.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: RegExp

    You have to enclose the string you want with brackets "(" and ")".

    EDIT: it is in the docs under "Capturing Text".

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

    pucara_faa (15th November 2009)

  4. #3
    Join Date
    Nov 2009
    Location
    Argentina
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: RegExp

    Hi,
    I've solved it by a simple way, althought it wasn't what I was looking for.
    In Perl, it's called "lookbehind", and it's applied like this "(?<=)".
    Qt doesn't support them, it just support lookahed.

    Thanks.

Similar Threads

  1. QDirModel with QSortFilterProxyModel and regexp
    By mchrk in forum Qt Programming
    Replies: 6
    Last Post: 15th January 2009, 11:13
  2. IPAddress Validator RegExp
    By user_mail07 in forum Qt Programming
    Replies: 0
    Last Post: 3rd April 2008, 02:36
  3. RegExp question
    By high_flyer in forum General Programming
    Replies: 1
    Last Post: 26th August 2007, 18:23
  4. QStringList.filter using RegExp
    By grellsworth in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 14:09
  5. Quick RegExp question
    By stealth86 in forum Qt Programming
    Replies: 3
    Last Post: 26th July 2007, 08:23

Tags for this Thread

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.