|
|
> The following code:
>
> QString strMessage ( "ERROR :Closing Link: testclient by
> Ede.NL.EU.UnderNet.Org (Too many connections from your host)" );
> QRegExp regExp ( "^ERROR :Closing Link: (.*) by (.*) (.*)$" );
> Why is "host)" separated from the above line?
Regexps are greedy, so the second (.*) is matching everything up to the
last space (including all spaces in between). You'll need to be craftier
with your regexp, using \w and \s as necessary instead of .*
I highly recommend using the regexptester program that is included in the
examples subdirectory of Qt so you can check your regexp matches. Very
helpful.
Caleb
--
List archive and information: http://lists.trolltech.com/qt-interest/
|
|