Tags:
create new tag
, view all tags

Question

I am trying to find all the Bibtex References in a web and run into trouble when I try to capture mutliple hits per page.

I defined a topic in which I include the following search

%SEARCH{ "STARTBIBTEX" scope="text" type="regex"  excludetopic="ReferencesInWeb"  nosearch="on" 
 nototal="on" header=""   format="   * [[$topic]] %BR% 
$pattern(.*STARTBIBTEX[^\n\r]*%(.*?)\n%STOPBIBTEX.*)" }%

This works fine, it outputs a bulleted list with a link to the topic followed by the first bibtex reference within. something like

  •  [[$topic]] 

     @article{...} 

However, it does not capture multiple hits per page, that is there is a single item per page regardless of the number of references it contains.

I presumed that adding multiple="on" to the search would help me capture multiple hits seamlessly. Indeed, because the regex is set to find only the first occurrence, I would have expected it to work just fine. However the corresponding piece of code

%SEARCH{ "STARTBIBTEX" scope="text" type="regex"    multiple="on" excludetopic="ReferencesInWeb"  
nosearch="on" nototal="on" header=""   format="   * [[$topic]] %BR% 
$pattern(.*STARTBIBTEX[^\n\r]*%(.*?)\n%STOPBIBTEX.*)" }%

produces only a bullet list like

  •  [[$topic]] 

In this list there are as many hits as expected (i.e. multiple bibtex references in a page result in multiple hits and translate into additional bullet items), however no text is extracted from neither single reference topics nor multiple reference topics.

I am running this on TWiki 4.05 and on TWiki 4.1. Behavior is the same on both.

Am I just trying to do something that cannot be done?

thank you very much

Environment

TWiki version: TWikiRelease04x01x00
TWiki plugins:  
Server OS: Mac OS X (Tiger)
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- LuisPerez - 29 Jan 2007

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.

I am afraid that it can not be done right now. In a multiple="on" search, the $pattern parameter is applied to each line which contains the search string. However, the pattern you want to expand spans multiple lines.

-- HaraldJoerg - 29 Jan 2007

 
Change status to:
Topic revision: r2 - 2007-01-29 - HaraldJoerg
 
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.