Tags:
create new tag
, view all tags

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

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin

-- 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

Topic revision: r3 - 2003-11-18 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.