Tags:
create new tag
view all tags

Question

How can I use some special chars line % and " within a search?

In my case I want to set up a search for the string:

%INCLUDE{"OutdatedPage"}%

this way:

%SEARCH{search="???" regex="on" scope="text" nosummary="on" nosearch="on" noheader="on" nototal="on"}%

Environment

TWiki version: TWikiRelease01Sep2001
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux
Web server: Apache
Perl version: v5.6.1
Client OS: Win XP
Web Browser: IE
Categories: Search

-- MichaelSzodorai - 08 Jul 2005

Answer

ALERT! 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.

Write:

%SEARCH{search="[%]INCLUDE{\"OutdatedPage\"}[%]" regex="on" scope="text" nosummary="on" nosearch="on" noheader="on" nototal="on"}%
To get this:

The square bracket with one char is like a no operation in regex, used to escape the INCLUDE action. Escape the quotes with backslash.

-- PeterThoeny - 01 Sep 2005

Has worked for me using \\ for backslash:

%SEARCH{search="[%]INCLUDE{\\"OutdatedPage\\"}[%]" regex="on" scope="text" nosummary="on" nosearch="on" noheader="on" nototal="on"}%

Thanks.

-- MichaelSzodorai- 02 Sep 2005

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2005-09-02 - MichaelSzodorai
 
  • 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.