PATCH: BR# 71590: Workaround for QRegExp bug in wildcard matching (globbing) mode.

Dawit A. adawit at kde.org
Mon Jan 5 15:05:39 GMT 2004


On Monday 05 January 2004 04:33, Waldo Bastian wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon January 05 2004 01:57, Dawit A. wrote:
> > Hello,
> >
> > The attached pactch addresses a bug in QRegExp::search that causes it to
> > make incorrect matches in wildcard (file globbing) mode.  The fix is
> > validated by the included test case. I have reported the bug to
> > TrollTech.
> >
> > QRegExp rx ("*.kde", true, true)
> > int res = rx.search( "www.kde.org");  // Should return -1. DOES NOT.
> > bool res2 = rx.exactMatch("www.kde.org"); // Works correctly.
>
> I fail to see the Qt problem actually. Either I misunderstand or you have
> just discovered that search and exactMatch are not the same. But that
> should hardly come as a surprise, no?

Well it is to me. The wildcard mode is supposed to implicitly behave like the 
globbing in *nix shells. To me this means that whether you use ::search 
or ::exactMatch the result should be the same or the distincation should at 
least be made clear in the docs.  Eventhough the wildcard matching example in 
the Qt docs uses exactMatch no where is it stated that using ::search in 
wildcard mode does not work as expected. I find that behavior confusing...

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"




More information about the kde-core-devel mailing list