Tags:
create new tag
view all tags
It would be nice to teach %SEARCH{...}% how support search patterns that span over several lines.

For instance this would allow matching several entries in forms.

I'm using the following patch for now.

--- TWiki.pm.old   Tue Sep 24 12:01:10 2002
+++ TWiki.pm   Tue Sep 24 11:58:36 2002
@@ -1025,6 +1025,7 @@
     my $attrLimit         = extractNameValuePair( $attributes, "limit" );
     my $attrReverse       = extractNameValuePair( $attributes, "reverse" );
     my $attrCasesensitive = extractNameValuePair( $attributes, "casesensitive" );
+    my $attrMultiLines    = extractNameValuePair( $attributes, "multilines" );
     my $attrNosummary     = extractNameValuePair( $attributes, "nosummary" );
     my $attrNosearch      = extractNameValuePair( $attributes, "nosearch" );
     my $attrNoheader      = extractNameValuePair( $attributes, "noheader" );
@@ -1040,7 +1041,8 @@
        $attrOrder, $attrRegex, $attrLimit, $attrReverse,
        $attrCasesensitive, $attrNosummary, $attrNosearch,
        $attrNoheader, $attrNototal, $attrBookview, $attrRenameview,
-       $attrShowlock, $attrNoEmpty, "", $attrHeader, $attrFormat 
+       $attrShowlock, $attrNoEmpty, "", $attrHeader, $attrFormat, 
+       $attrMultiLines
     );
 }
 
--- TWiki/Search.pm.orig   Mon Sep 23 22:00:25 2002
+++ TWiki/Search.pm   Tue Sep 24 11:55:24 2002
@@ -57,7 +57,7 @@
          $theRegex, $theLimit, $revSort, $caseSensitive, $noSummary,
          $noSearch, $noHeader, $noTotal, $doBookView, $doRenameView,
          $doShowLock, $noEmpty, $theTemplate, $theHeader, $theFormat,
-         @junk ) = @_;
+         $multiLines, @junk ) = @_;
 
     ## 0501 kk : vvv new option to limit results
     # process the result limit here, this is the 'global' limit for
@@ -209,6 +209,8 @@
     } else {
         $tempVal = "-i";
     }
+    $tempVal .= " -z" if $multiLines;
+   
     $cmd =~ s/%SWITCHES%/$tempVal/go;
 
     if( $theRegex ) {

You can see this in action at http://www.lrde.epita.fr:800/cgi-bin/twiki/view/Publications/Papers

The first list on this page is a search of all forms that have "Type" = "InJournal" and "Status" = "(published|to appear)".

FWIW I'm using the 01-Dec-2001 version of TWiki.

-- AlexandreDuretLutz - 24 Sep 2002

This should already be possible - see SearchWithAnd, which is incorporated in the TWiki core in BeijingRelease, i.e. current TWikiBetaReleases. I did something like this with a separate andgrep and Dec 2000 TWiki code - the way that forms are stored has since changed but this should be possible. Try the beta code anyway and if you don't want to upgrade, search Codev for andgrep.

-- RichardDonkin - 25 Sep 2002

The $attrMultiLines switch is an interesting idea. As Richard said, you should get the same functionality with the AND search. Let us know if this is sufficient, I'd like to set this to FeatureNotSuitable to KISS.

-- PeterThoeny - 26 Sep 2002

Thanks for your answers. I think SearchWithAnd is enough for me.

-- AlexandreDuretLutz - 13 Oct 2002

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2002-10-13 - AlexandreDuretLutz
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.