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
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
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
--
LuisPerez - 29 Jan 2007
Answer
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.
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