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
--
ChengappaCB - 23 Jan 2008
Answer
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.
%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