Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
| ||||||||
Line: 50 to 50 | ||||||||
Note: For $pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, like $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised; for example, if you include a table make sure to include everything including the table end tag. | ||||||||
Deleted: | ||||||||
< < | Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. We want to search for topics, do a nested search with each hit, and show the result as nested bullets. Parameters likescope="text" regex="on" nosearch="on" nototal="on" are omitted for simplicity.
| |||||||
Examples | ||||||||
Added: | ||||||||
> > | ||||||||
Bullet list showing topic name and summary | ||||||||
Changed: | ||||||||
< < | Write this: | |||||||
> > | Write this: | |||||||
%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header=" * *Topic: Summary:*" format=" * [[$topic]]: $summary" }% | ||||||||
Changed: | ||||||||
< < | To get this: | |||||||
> > | To get this: | |||||||
| ||||||||
Added: | ||||||||
> > | ||||||||
Table showing form field values of topics with a form | ||||||||
Changed: | ||||||||
< < | Write this in the Know web: | |||||||
> > | Write this in the Know web: | |||||||
| *Topic:* | *OperatingSystem:* | *OsVersion:* | %SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }% | ||||||||
Changed: | ||||||||
< < | To get this: | |||||||
> > | To get this: | |||||||
| ||||||||
Line: 106 to 88 | ||||||||
| ||||||||
Added: | ||||||||
> > | ||||||||
Extract some text from a topic using regular expression | ||||||||
Changed: | ||||||||
< < | Write this: | |||||||
> > | Write this: | |||||||
%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format=" * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }% | ||||||||
Changed: | ||||||||
< < | To get this: | |||||||
> > | To get this: | |||||||
TWiki FAQs:
| ||||||||
Added: | ||||||||
> > |
Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. Let's search for all topics that contain the word "culture" (first search), and let's find out where each topic found is linked from (second search).
%SEARCH{ "culture" format=" * $topic is referenced by:$n * $percntSEARCH{ \"$topic\" format=\" $dollartopic\" nosearch=\"on\" nototal=\"on\" }$nop%" nosearch="on" nototal="on" }%
To get this:
| |||||||
-- PeterThoeny - 16 May 2002 |