Tags:
create new tag
view all tags

Question

I am trying to get a FormattedSearch to create a news listing. The idea is to use TWiki's News-Icon %N% as a tag, so I try to run a regex SEARCH for the pattern. But either text replacement resolves the pattern before sending it to grep or grep returns an error.

Any of the used patterns seem to work using grep directly. We are using GnuWin32-grep in Windows 2000 Professional. Here are some of the various versions I tried and their results.


%SEARCH{"%N%" scope="text"  web="all" type="regex"}%

Searched: <img src="/twiki/pub/TWiki/TWikiDocGraphics/new.gif

%SEARCH{"$percntN$percnt" scope="text"  web="all" type="regex"}%

Searched: $percntN$percnt

%SEARCH{"%N%" scope="text"  web="all" type="regex"}%

Could not perform search. Error was: c:/PROGRA~1/GnuWin32/bin/grep -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '%N%' returned error

%SEARCH{"[%]N[%]" scope="text"  web="all" type="regex"}%

Could not perform search. Error was: c:/PROGRA~1/GnuWin32/bin/grep -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '[%]N[%]' returned error

%SEARCH{"\%N\%" scope="text"  web="all" type="regex"}%

Could not perform search. Error was: c:/PROGRA~1/GnuWin32/bin/grep -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '\%N\%' returned error


I am not sure how to interpret the errors. Is it the pattern causing an error or are the two options %TOKEN|U% %FILES|F% faulty - they seem to be uninterpreted parts. The latter would suggest a problem within the search perl package with the percent sign.

Is there actually a bug, then how may I fix it, or is there a way to escape the percent sign properly? Or am I missing something really obvious..?

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2000 Professional
Web server: Apache 2.2.4
Perl version: ActivePerl 5.8.8
Client OS: Windows XP SP2
Web Browser: Firefox 2.0
Categories: Search

-- PhilippSGeisler - 29 May 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

That last one worked for me, and it works here too (below).

I'm using GnuWin32 as well, but the grep string in that error seems to be non-standard. What do you have for the following 'configure' settings (my values are shown, morphed into your path):

  • {RCS}{SearchAlgorithm} = TWiki::Store::SearchAlgorithms::Forking
  • {RCS}{EgrepCmd} = c:/PROGRA~1/GnuWin32/bin/grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%
  • {RCS}{FgrepCmd} = c:/PROGRA~1/GnuWin32/bin/grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%

Searched: \%N\%

Results from Sandbox web retrieved at 02:56 (GMT)

This page contains information about the Naples team http://home.web.cern.ch/topics/large hadron collider @LHC ATLAS Naples Team Official Website Introduction...
ATLASNapoliPoDStudies This page contains information about the Latency and Analysis PoD Studies Italy 2013: For more information, please see: Studies Italy...
This page contains information about the official MC productions tasks for the ATLAS Collaboration ATLAS Naples Team Official Website ATLAS MC Tasks Production...
Number of topics: 3

-- SeanCMorgan - 29 May 2008

Thanks for your answer.

These are my settings:

  • {RCS}{SearchAlgorithm} TWiki::Store::SearchAlgorithms::Forking
  • {RCS}{EgrepCmd} c:/PROGRA~1/GnuWin32/bin/grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%
  • {RCS}{FgrepCmd} c:/PROGRA~1/GnuWin32/bin/grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%

There seems to be no difference...

-- PhilippSGeisler - 30 May 2008

Indeed they are the same.

What do you get with "grep -V"? I used the Windows installer for TWiki, so mine says, grep (GNU grep) 2.5.1.

-- SeanCMorgan - 31 May 2008

It's grep (GNU grep) 2.4.2.

We are currently moving the TWiki installation from Windows to Linux, where there'll be the proper grep version 2.5.3, so I hope the problem will get resolved on it's own by this move.

I'll keep you updated and will eventually close the question.

-- PhilippSGeisler - 02 Jun 2008

Problem has been resolved by moving to Ubuntu Linux with GNU grep 2.5.3. Thank you for your help.

-- PhilippSGeisler - 02 Jun 2008

Change status to:
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-06-02 - PhilippSGeisler
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.