Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: Cant anchor a search RE to end

If you try to anchor a search RE to the end using the $ RE operator, the expression fails to work correctly.

Test case

This search:

  • %SEARCH{search="StatusReport$" scope="topic"}%

will not find all topics that end in "StatusReport" as it should (in fact it doesn't find any).

This roughly similar search works for finding topics that don't begin with "StatusReport":

  • %SEARCH{search=".+StatusReport" scope="topic"}%

But it obviously isn't the same thing and it won't work in my application.

Environment

TWiki version: 01 Dec 2001

TWiki plugins: as distributed
Server OS: FreeBSD
Web server: Apache
Perl version: 5.005_03
Client OS: FreeBSD
Web Browser: Netscape

-- RobertWithrow - 10 Jan 2002

Follow up

No fix, just restating the problem: The $ anchor doesn't seem to work in a regular expression search, either on the search page or in an inline search. Is this the intended behavior?

For the time being, I will try the .+ workaround which might serve my purposes (temporarily) on the AbiWord TWiki -- I'll do some experimenting.

UPDATE: Although .+ works, that didn't solve my problem on the AbiWord TWiki FAQ, but I did arrange things so that ^ does. Still, this is, AFAICT, a bug, and should be left open until it's either fixed or documented.

This should be moved to the support web, I added these comments here to try to call attention to this existing topic.

-- RandyKramer - 10 Jul 2002

Fix record

This is fixed now. The problem was that a search with scope="topic" does search for files ending in *.txt, causing the the $ RE operator to fail.

217a218,222
>         if( $theScope eq "topic" ) {
>             # Fix for Codev.CantAnchorSearchREToEnd
>             @tokens = map { s/\$$/\\\.txt\$/o; $_ } @tokens;

In TWikiAlphaRelease and TWiki.org.

-- PeterThoeny - 16 Jul 2002

Thanks!

-- RandyKramer - 16 Jul 2002

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2002-07-16 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.