Question
I would like to search with wildcards for multiple categories in the body text. Maybe there are no wildcards needed... In the first search I wanna find only "Categroy1" and in the second "Category2".
This is how the categories are set in a topic and there are, as in this example, in a table:
| Categories: |
Category1, Categroy2 |
It's hard to get the right
$pattern( ... ) syntax.
Maybe someone can help me out.
Here another issue... I got a topic with following information included in a table, this topic is also assigned to a
TWikiForm (Field=TopicClassification, Value=Category1):
On a diffrent site I want to extract the above mentioned information:
%SEARCH{ "[T]opicClassification.*?value=\"[C]ategory1"" scope="text" regex="on" nosearch="on" nototal="on" format="|
$topic | ? | ? | ? | ? |" }
How has the $pattern variable has to look like where the "?" are?
I'm very thankfull for help!
Environment
--
ThomasEsau - 20 Nov 2006
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.
Here is the regex to find just
Category2:
Categories: \s*\|.*Category2
On extracting selected content, you need a
$pattern() in the format. Untested example to extract
Name:
format="| [[$topic]] | $pattern(^\| \s*Name \s*\| \s*([^\|]*).*) | etc. |"
See details in
VarSEARCH,
FormattedSearch and
SearchPatternCookbook.
--
PeterThoeny - 20 Nov 2006