Tags:
create new tag
, view all tags

Question

I have used the command below to search for and list all the topics which contain the word PPI.

%SEARCH{ "PPI" scope="topic" nosearch="on" nototal="on" header="---+++PPI forms $n" format="[[$topic]] $n" }% 

The result is:

PPI forms

ListOfPPIforms

PPIform

PPIformCreator

PPInewcandidate

But I want just the topics which start with the word PPI. What is the modification to be made in the search command ? I tried

%SEARCH{ "PPI*"... 
but it did not work

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2003
Web server: Apache 1.3.39
Perl version: 5.008008 (cygwin)
Client OS: Windows XP
Web Browser: IE 6
Categories: Search

-- ChengappaCB - 23 Jan 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

%SEARCH{ "^PPI" scope="topic" type="regex" nosearch="on" nototal="on" header="---+++PPI forms $n" format="[[$topic]] $n" }% 
should do the trick.

-- FranzJosefGigler - 23 Jan 2008

Thanks Franz!. That does it. Where can I get help on the these parameters that can be used ? (like type, scope, nosearch, nototal, regex etc and also if I want a list of topics ending with a word etc). I tried looking into FormattedSearch but I couldn't get much help.

-- ChengappaCB - 23 Jan 2008

All possible parameters of SEARCH are described on VarSEARCH. On RegularExpression you find some necessary regex basics. With release 4.2 you alternatively can use QuerySearch (type="query") constructs to find and format what you need. Great stuff! Try it!

%SEARCH{ "name~'PPI*'" scope="topic" type="query" nosearch="on" nototal="on" header="---+++PPI forms $n" format="[[$topic]] $n" }% 
should return the same result.

-- FranzJosefGigler - 23 Jan 2008

What does ^ mean in a search ? As per an example in RegularExpression, it looks like ^ means excluding. but in the answer to my query, it looks like starting with.

-- ChengappaCB - 23 Jan 2008

^ (tophat) normally means starting with as you say. When it is in brackets [^text] it means NOT text

-- LarsEik - 23 Jan 2008

Maybe some day someone writes a TWiki specific RegularExpressionTutorial, although there are plenty of infos out there in the wild (Internet), there are even books about the (secret) art of regex (got one as christmas present a few years ago).

-- FranzJosefGigler - 23 Jan 2008

 
Change status to:
Topic revision: r7 - 2008-01-23 - FranzJosefGigler
 
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.