Results 1 to 13 of 13

Thread: Regex to filter words containing english alphabets

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Regex to filter words containing english alphabets

    The fastest approach I can think of is to use something similar to QStringRef where you will not copy the data from the original string in every iteration but instead mark positions and lengths of every valid token and at the end extract those tokens from the string in one go, possibly with merging the marks so that you can extract as large areas as possible. Then you avoid the split, avoid copying data and other expensive operations. And you will omit the effect of your current implementation that doesn't preserve whitespaces.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2011
    Location
    New Delhi, India
    Posts
    31
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60
    Thanks
    6

    Default Re: Regex to filter words containing english alphabets

    I have to try it out...!! Not getting it at present, but will try it for sure.

    It's already dawn here, will try after some rest.

Similar Threads

  1. Partial matching of regex
    By ehamberg in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2008, 20:13
  2. Adding 3 words to Button with specified length betwwen words
    By chikkireddi in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 11:08
  3. Having a brain cramp on a regex
    By Spockmeat in forum Qt Programming
    Replies: 2
    Last Post: 16th July 2007, 14:26
  4. Problem with regex
    By mikro in forum Newbie
    Replies: 4
    Last Post: 14th December 2006, 10:43
  5. need help with my regex
    By patcito in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 17:39

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
  •  
Qt is a trademark of The Qt Company.