Results 1 to 1 of 1

Thread: How to use QRegExp to check if a QString contains 3 letters consecutively?

  1. #1
    Join Date
    Apr 2020
    Posts
    4
    Thanks
    2

    Default Re: How to use QRegExp to check if a QString contains 3 letters consecutively?

    Hi,

    I have a QString of 8 to 9 in length, containing alphabetic letters and digits. I need to check if they contains at least 3 alphabetic letters consecutively using QRegExp (or any other valid way), such as "12AXY359A1", where "AXY" are 3 consecutive letters without digit in between?

    Any QString containing 3 or more consecutive alphabetic letters, I need it to returns false, otherwise returns true.

    Many thanks.


    Added after 1 47 minutes:


    Look like QRegExp( "[A-Z]{3,}", Qt::CaseInsensitive ) works.
    Last edited by sophvic; 6th February 2022 at 22:36.

Similar Threads

  1. Recover a QString with QRegExp
    By hassinoss in forum Qt Programming
    Replies: 5
    Last Post: 27th February 2014, 16:04
  2. QregExp: matching accented letters
    By bred in forum Qt Programming
    Replies: 0
    Last Post: 4th January 2011, 10:48
  3. Search for QRegExp in a QString
    By Abc in forum Qt Programming
    Replies: 6
    Last Post: 13th August 2008, 09:31
  4. QString manipulation - QRegExp
    By mattia in forum Newbie
    Replies: 1
    Last Post: 18th March 2008, 11:21
  5. qregexp to check string
    By mattia in forum Newbie
    Replies: 3
    Last Post: 19th February 2008, 14:13

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.