Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:16:13+00:00 2026-05-26T15:16:13+00:00

I am currently working on a Qt C++ application on Mac. Throughout the application

  • 0

I am currently working on a Qt C++ application on Mac.
Throughout the application I am using string pattern matching pretty frequently.
When using the QRegExp class, I keep having trouble with something that I just don’t understand!!!

My QRegExp looks like this :

QRegExp regEx("M|F\\dS\\d\\d.C\\d\\d", Qt::CaseInsensitive);

It is supposed to match patterns like “M1S02.C12” or “F4S14.C01” in filenames.
This works great as soon as the input filenames, which should be matched don’t contain parts of this pattern.

For example :
my input file is named “testItem_abcd_M1S03.C02_grade3”

regEx.exactMatch("testItem_abcd_M1S03.C02_grade3");

returns false, whereas

regEx.indexIn("testItem_abcd_M1S03.C02_grade3");

returns 7, which is the position of “m” in “item”.

Can someone please tell me, what I would need to do to make it match right?

Thanks in advance,
guitarflow

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:16:14+00:00Added an answer on May 26, 2026 at 3:16 pm

    The problem is that the | restricts to searching either M or F\dS\d\d.C\d\d. So the sinle m of item will match.

    Try "[MF]\\dS\\d\\d\\.C\\d\\d" instead.
    (Note: Also replaced . with \\., as a single dot matches any character)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on an application that allows reverse geocoding using silverlight +
I am currently working on an application using WPF and MVVM. Now if I
I'm using an IKImageBrowserView for a mac application I'm currently developing and wants to
Currently working on an ASP.NET MVC 3.0 application and using FormsAuthentication . When the
Currently working on a bespoke ecommerce application using Codeigniter. I have a products table
Am currently working on an application that requires users to submit posts and comments
I'm currently working on an application with a frontend written in Adobe Flex 3.
We are currently working on an application that will use a WCF service. The
I'm currently working on desktop application which calls third party API. After authorizing against
I'm currently working in an application that has to navigate a webpage and recollect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.