Difference: SearchPatternCookbook (1 vs. 6)

Revision 62009-04-24 - TWikiContributor

Line: 1 to 1
 
META TOPICPARENT name="FormattedSearch"

Search Pattern Cookbook

Line: 368 to 368
 %SEARCH{ "[O]peratingSystem.*value\=.*[O]sWin" type="regex" ... }%
  • Using square brackets is a trick to avoid a hit on the topic doing the search.
Changed:
<
<
  • The .* indicate that there can be any number of any character between OperatingSystem and value in the (whole) file
>
>
  • The .* indicate that there can be any number of characters between OperatingSystem and value in the (whole) file
  Now the original file format of the category table (the predecessor of the TWiki forms) looks like this:

Revision 52007-01-14 - TWikiContributor

Line: 1 to 1
 
META TOPICPARENT name="FormattedSearch"

Search Pattern Cookbook

Line: 105 to 105
 

Solution 1: Appropriate for Sep 2004 TWiki (Cairo)

Changed:
<
<
>
>
 
Changed:
<
<
>
>
 
Line: 116 to 116
  Which expands to this: (here limited to all Z* users because TWiki.org has so many)
Changed:
<
<
>
>
 
Changed:
<
<
>
>
 
Changed:
<
<
This searches all topics in the Main web that contain "Name", "Email" and "Country" bullets. Alternatively, do a FormattedSearch with multiple="on" on the Main.TWikiUsers topic.
>
>
This searches all topics in the Main web that contain "Name", "Email" and "Country" bullets. Alternatively, do a FormattedSearch with multiple="on" on the Main.TWikiUsers topic.
 

Solution 2: As Solution 1, but with possibility for multi-selecting usernames

Line: 136 to 136
 Please note that the Search pattern is unchanged compared to Solution 1. The change is in the HTML form element.

The abovementioned modification is, in effect:

Changed:
<
<
>
>
 
Changed:
<
<
>
>
 
Line: 149 to 149
 When the User information is stored in a UserForm (as is default in Dakar) then this list can be generated as follows:
Changed:
<
<
>
>
 
Changed:
<
<
Number of topics: 10828
<--/patternSearchResultCount-->

>
>
Number of topics: 10828
<--/patternSearchResultCount-->

 

Revision 42007-01-14 - TWikiContributor

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FormattedSearch"
 

Search Pattern Cookbook

The Search function in TWiki is very powerful. Especially searches using a RegularExpression play an important part of tapping TWiki's full potential. Unfortunately RegularExpressions can be incredibly obscure to the uninitiated.

Most people not familiar (enough) with Regular Expressions mostly cut and paste (and maybe tweak) from existing examples. This page intends to collect lots of examples together.

Changed:
<
<
>
>
 
Added:
>
>
<-- ========================== -->
 

Pattern 1: Extract values from a table

Problem definition

Line: 27 to 32
 
<form>
<select>
Changed:
<
<
>
>
 
Line: 35 to 40
 which is, in effect:
Changed:
<
<
>
>
 
Deleted:
<
<

 
Added:
>
>
<-- ========================== -->
 

Pattern 2: List generated from form classification

Problem

Line: 61 to 70
 
%SEARCH{"[T]opicClassification.*value\=.*Two;[T]opicStatus.*value\=.*%URLPARAM{type}%"
Changed:
<
<
regex="on" casesensitive="on" nosearch="on"
>
>
type="regex" casesensitive="on" nosearch="on"
 format=" * $topic - last modified by $wikiusername on $date
    $formfield(TopicStatus) "
Line: 75 to 84
 Filter:
Changed:
<
<
%SEARCH{ "^\|[^\|]*\| *option *\|" topic="TopicClassification" web="TWiki" regex="on"
>
>
%SEARCH{ "^\|[^\|]*\| *option *\|" topic="TopicClassification" web="TWiki" type="regex"
 multiple="on" nosearch="on" nototal="on" format="" }%
Line: 83 to 92
 

This will create similar functionality as TWiki:Plugins.TopicClassificationAddOn

Deleted:
<
<

 
Added:
>
>
<-- ========================== -->
 

Pattern 3: Creating lists of TWiki usernames

Problem

Line: 139 to 152
 
Changed:
<
<
Number of topics: 10828
<--/patternSearchResultCount-->

>
>