Results 1 to 3 of 3

Thread: Regular Expression Problem

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Regular Expression Problem

    Hi,

    I want to validate the inputs like "xxxx.xxxx" where x can be any integer from 0-9.
    how can i write a regular expression for this?

    Please help....

    Regards,
    GK

  2. #2
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Regular Expression Problem

    I believe it would be [0-9]{4}\\.[0-9]{4}
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  3. #3
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Regular Expression Problem

    That sovles the poblem... thanks...
    but i ran into another problem....

    This works fine until i setModel for the combo.
    After i setModel for the comboBox.. the validation is all gone and i can type in whatever i want.

    Am i missing something.. here...


    Regards,
    GK

Similar Threads

  1. Regular Expression for QDate [YYYY/MM/DD] format
    By bera82 in forum Qt Programming
    Replies: 6
    Last Post: 3rd August 2019, 09:40
  2. set a regular expression on QTextEdit
    By mattia in forum Newbie
    Replies: 3
    Last Post: 27th March 2008, 10:16
  3. Regular expression in QLineEdit?
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2007, 10:58
  4. Find with Regular Expression?
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 14:44
  5. How to get a QString from a file (use regular expression)
    By fengtian.we in forum Qt Programming
    Replies: 16
    Last Post: 31st May 2007, 11:06

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.