Question
I am trying to do an imbedded search using a regex, but am having trouble making it work across multiple lines.
One of the pages I am searching looks as follows (the all have a similar format):
Use Case Name:
SystemUseCase
The search I am executing is:
%SEARCH{"Use Case Name:[\n\r]*System" scope="topic" regex="on" nosearch="on" format="| $topic | $date - $rev - [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic][Diffs]] |"}%
I am sure I am doing something wrong, just can't figure out what it is, but I would expect this search to return results, however I get 0 matches. I think the CR/LF is what is getting me, just not sure how to handle them. Any guidance would be appreciated.
Environment
--
LarryDeane - 17 Nov 2003
Answer
TWiki uses external grep for search which is line oriented. You cannot search a term across lines. As a workaround you can do an AND search like
"^\-\-\-\+\+ Use Case Name:;^System", but this will catch these two strings anywhere at the beginning of a any two line, not consecutive lines.
For this type of application it is better to use
TWikiForms because you add structure data to unstructured data. This way you get more flexibility for reporting. For example, you can even summarize the form elements on the topic itself with a formatted
%SEARCH{ "^%TOPIC%$" ... }%
--
PeterThoeny - 18 Nov 2003