Tags:
create new tag
, view all tags

Bug: Type=regex Search does not Work as Expected

I like to use searches rather than manual lists where I can, so I wanted TWikiGroups to search for access group definitions. I tried to create this search:

%SEARCH{"Group$" scope="topic" noheader="on" nosearch="on" nosummary="on" type="regex"}%

Test case

(in each of the stages below I have used "Expected" instead of "Group" as the end of the topic name I want, to demonstrate the results when the query is run in this web)

OK, searching for topics whose names end in "Expected".

%SEARCH{"Expected$" scope="topic" noheader="on" nosearch="on" nosummary="on" type="regex"}%
returns
Number of topics: 3

So, cribbing the documentation, I limited it to a range of topics:

%SEARCH{"Expected$" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which returns
Number of topics: 3

Nope, still no joy. So I searched for the empty string instead, since all the topics should contain it:

%SEARCH{"" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which gives

Losing patience, I tried this instead:

%SEARCH{"Expected" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which returns
Number of topics: 3
Eureka! Now, why didn't any of the other searches work, when the documentation certainly suggests they all should have?

BTW, using regex="on" instead of type="regex" does this:

%SEARCH{"Expected$" scope="topic" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 3

%SEARCH{"Expected$" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 3

%SEARCH{"" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%

%SEARCH{"Expected" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 3

Environment

TWiki version: TWikiBetaRelease
TWiki plugins: Most of them
Server OS: RH 7.3
Web server: Apache 2
Perl version: 5.6.1
Client OS: SuSe Linux 9
Web Browser: Konqueror

-- CrawfordCurrie - 27 Feb 2004

Follow up

This is a bug cloned from Support.SearchDoesNotWorkAsExpected. type="regex" and regex="on" (deprecated) should behave the same.

Fix record

Fix is in TWikiAlphaRelease (not yet at TWiki.org)

-- PeterThoeny - 29 Feb 2004

Topic revision: r2 - 2004-04-28 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.