Permalink
Browse files

Item11746: search example for grabbing the entire row for each hit

git-svn-id: http://svn.foswiki.org/branches/Release01x01@15753 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
ArthurClemens ArthurClemens
ArthurClemens authored and ArthurClemens committed Oct 28, 2012
1 parent 5ef7671 commit a714d3118bce66cefece6caa773a74261c223269
Showing with 33 additions and 0 deletions.
  1. +33 −0 core/data/System/SearchPatternCookbook.txt
@@ -96,6 +96,39 @@ Which renders as:
}%
</select>
---+++ Solution 3
If you want to grab the complete row for each occurrence of a string in a table, for instance the word "Marketing":
<verbatim class="tml">
| a | b | c | d | e |
| Marketing | b | c | d | e|
| a | b | c | d | e |
| a | marketing | c | d | e |
| a | b | c | d | marketing |
</verbatim>
use this query:
<verbatim class="tml">
%SEARCH{
"^\|.*?Marketing.*"
type="regex"
topic="%TOPIC%"
multiple="on"
nonoise="on"
format="| $pattern(^\| *(.*?) *|.*)"
}%
</verbatim>
Which renders as:
%SEARCH{
"^\|.*?Marketing.*"
type="regex"
topic="%TOPIC%"
multiple="on"
nonoise="on"
format="| $pattern(^\| *(.*?) *|.*)"
}%
<!-- ============================== -->
#SearchFormClassification
---++ Pattern 2: List generated from form classification

0 comments on commit a714d31

Please sign in to comment.