[Qt-interest] more hits on QRegExp

Kaleb Pederson kaleb.pederson at gmail.com
Mon Jul 20 20:18:20 CEST 2009


On Sun, Jul 19, 2009 at 12:22 PM, Frank Lutz<frank422542 at googlemail.com> wrote:
> Hi,
>
> i do have a string with the syntax:
>
> ...
> <xyz>A</xyz>
> <xyz>B</xyz>
> <xyz>C</xyz>
> ...
>
> now i want get the values with:
> QRegExp exp;
> exp.setPattern(".*<xyz>(.*)</xyz>.*");
> exp.exactMatch(str);
>
> for(int i=0;i<10;i++){
>        qDebug()<<exp.cap(i);
> }
>
> But it didn't work well :think:

What does didn't work well mean?  What did or did it not do?

Maybe instead of doing an exact match, you want to search through the string?

--Kaleb




More information about the Qt-interest-old mailing list