Results 1 to 11 of 11

Thread: Regular expression help!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Regular expression help!

    Hi,
    I'm need a help to make a regular expression.
    I need a regular expression that validate a string with the following rules:

    1- The first character allowed are a-z and A-Z.
    2- Is allowed to put after the the first character a-z, A-Z, 0-9, . and -.
    3- It not allowed sequence of period(.). (e.g. "qt..framework" its not valid)
    5- The string can be infinity.
    6- The end of string can't contain . or -.

    I tryed to do my own regexp and the result was "(([a-zA-Z][-a-zA-Z0-9]*(\\.[-a-zA-Z0-9]+)*)[^-.]+$)".
    My huge problem its to validate the end of string, checking if there is some - or ..
    When i put "[^-.]+$" i have two problens one is that i get Intermediate result from
    QRegExpValidator::validate() and second is when i put only a character to be
    validate i got Intermediate result too.

    Can someone help me?
    Thanks
    Last edited by ConkerX; 30th August 2011 at 19:46.

Similar Threads

  1. Help with regular expression
    By Gourmet in forum General Programming
    Replies: 19
    Last Post: 11th August 2011, 15:04
  2. Regular Expression Problem
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2009, 09:41
  3. set a regular expression on QTextEdit
    By mattia in forum Newbie
    Replies: 3
    Last Post: 27th March 2008, 10:16
  4. Regular expression in QLineEdit?
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2007, 10:58
  5. Find with Regular Expression?
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 14:44

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.