I wanted to make a search such that I could use the result in a regular expression, so I selected the separator |. Here's what happened:

%SEARCH{"Etruscan Art" format="$topic" separator="|"}% :
Searched: Etruscan Art
Item4784
Number of topics: 1

As you can see, there is an extra | at the end of the list, which makes the RE unusable. The separator should separate the search terms, it shouldn't also terminate the list.

-- TWiki:Main/CrawfordCurrie - 08 Oct 2007

First result of debugging: There are at least two bugs.
  1. The code tries to remove the final separator around Search.pm line 1023, but at this place the summary "Number of topics" is already in place.
  2. Using nototal="on" doesn't help at all, of course, because the separator has a meaning in a regex (try separator="*" for a more disastrous example of this error). The second bug needs to be fixed by enclosing the regexp with \Q$separator\E$, for the first it is now too late.

-- TWiki:Main.HaraldJoerg - 08 Oct 2007


It emerges that it's due to the way the list of results is built. There is code to remove the trailing separator from the list (this is a really bad way to build a list, but oh what the hell)

Solution was to quotemeta the string used in the replacement RE, which was the second of Harald's suggestions and seems to fix it.

CC


Not yet "Waiting for Release"! It doesn't work unless you set nototal="on"!

It could be lowered to "Normal", though, because it is unlikely that a formatting application can do with the "Number of topics" string, but not with a trailing separator.

-- TWiki:Main.HaraldJoerg - 08 Oct 2007

OK, sorry, I didn't understand your report before. Lowered to Normal.

CC

This item has targetrelease minor (which is getting closer), but no waiting for?

-- TWiki:Main.SteffenPoulsen - 22 Dec 2007

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads