[Qt-interest] Problem with QRegExp

Jan Dinger dinger.jan at googlemail.com
Tue Feb 10 15:02:25 CET 2009


Hello folks,

i've problem to find a string in QString.

Hiere is my QString:
### snip ###
QString tmp =  "ii  debhelper                            7.0.15
                helper programs for debian/rules";
### snap ###

Now, I'll search for "debhelper".

Here is my construction to search for "debhelper".

### snip ###
QRegExp rx("^(\\s+)debhelper$");
rx.setPatternSyntax(QRegExp::Wildcard);

if (rx.exactMatch(tmp))
    qDebug() << "string includes debhelper";
### snap ###

The construction can't find debhelper in the string, can someone tell
me how must I build the QRegExp correctly?

Thanks for help.

so long
jd



More information about the Qt-interest-old mailing list