Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] QRegExp doesn't match strings
I want a regular expression able to catch strings that start with a pair of repeated letters so I wrote the following:
As far as I know It should match this string:
and It doesn't.
What am I doing wrong?
What output do you expect ? And what do you get ?
When I use
@QRegExp::exactMatch ( const QString & str ) const@
I always get false.
I tried here and It worked:
Have a look at the documentation of exactMatch. Your string doesn't match exactly your regexp. If it was "aa" it would.
You should rather use indexIn
You're welcome !
Don't forget to update the thread's title by prepending solved so other forum users may know a solution has been found :)