Question
Based on the description in page
http://twiki.org/cgi-bin/view/TWiki04/RegularExpression
I think %SEARCH{ "[Aa].*" scope="topic" order="topic"... can find out all topics that have topic name begin with A (ignore case).
But actually topics like
WebSearch or
WebLeftBar that have 'a' in the middle also appear in the result. What is the problem?
Environment
--
MagicYang - 19 Dec 2007
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{ "^[Aa].*" scope="topic" order="topic" type="regex" format=" * $topic" limit="16" }%
Search:
^[Aa].*
Number of topics: 16
But -- ähm -- it's pretty unlikely that you will get topics starting with a lowercase letter.
And SEARCH ignores case anyway until you use
casesensitive="on".
More interesting is a search for topics ending with a certain letter. This can be done by something like:
%SEARCH{ ".*[A]$" scope="topic" order="topic" type="regex" casesensitive="on" format=" * $topic" limit="16" }%
Search:
.*[A]$
Number of topics: 1
Regular expressions are fascinating, indeed.
--
FranzJosefGigler - 19 Dec 2007
Thanks a lot! You are really good that the knowledge and sample should be put in
RegularExpression topic in formal documents. There are too little information in these documents.
--
MagicYang - 20 Dec 2007