Tags:
create new tag
, view all tags

Question

I am trying to search for hidden variables set within a page but do not get a result. What am doing wrong.


<!--
   * Set MYVAR = OPEN
-->

on another page...
%SEARCH{"^   * MYVAR = OPEN" scope="text" regex="on"}%

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: WIN32
Web server: Apache
Perl version: 5.10
Client OS: W2K
Web Browser: IE7
Categories: Search

-- BrianTibbels - 31 Mar 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

The regex looks OK except that the * needs to be escaped. It might be safer to search for whitespace since older TWiki versions saved bullets with a leading tab instead of three spaces. The ^ anchor does not work for some reason. Below is an example that works.

Search on this topic:
%SEARCH{ "[ \t]+\* MYVAR = OPEN" scope="text" topic="Search*" regex="on" nonoise="on" format="found <nop>$topic" }%

Resulting in:
found SearchWithinHTMLComments

-- PeterThoeny - 01 Apr 2008

Many thanks Peter - spot on.

-- BrianTibbels - 02 Apr 2008

 
Change status to:
Topic revision: r3 - 2008-04-02 - BrianTibbels
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, 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.