Question
I am trying to find multiple matches within one topic using search.
MultipleSearchesInSameTopic discusses this, still it does not work for me.
example
I would like to extract the names of all contributors to this topic. I assume it starts with "Main" and would like to print the part after it.
in
%SEARCH{ "-- Main" topic="HowtoMultipleSearchesInSameTopic" multiple="on" scope="text" regex="on" nosearch="on" nototal="on" format="$pattern(.*Main(.*)) $n"}%
out
)
)
)
)
)
)
The code handles this via
$tempVal =~ s/\$pattern\((.*?\s*\.\*)\)/getTextPattern( $text, $1 )/geos;
It is especially unclear to me how this is supposed to handle nested '(' ')'
Still it seems to work for the rest of the world. What am I doing wrong?
--
FrankHartmann - 08 Nov 2004
Environment
--
FrankHartmann - 08 Nov 2004
Answer
in
%SEARCH{ "-- \[*Main" format="$pattern(.*-- \[*(Main.[^ \]\n\r]+).*) $n" topic="HowtoMultipleSearchesInSameTopic" multiple="on" scope="text" regex="on" nosearch="on" nototal="on"}%
out
FrankHartmann
FrankHartmann
SamHasler
SamHasler
SamHasler
SamHasler
shake it all about
That's modified from the example
FormattedSearch
The documentation could perhaps do with some more verbose explanations for the examples to explain why they were written the way they are, and a troubleshooting sections of common problems with examples that don't work and how they should be written.
Let's also have a sig without a date because you probably want it to pick up those.
--
SamHasler
There are other common formats that this might not pick up.
- Does it pick up initials? -- SH - 08 Nov 2004
- Does it pick up initials, without a date? -- SH
yes it does
--
SamHasler - 08 Nov 2004
Sam, many thanks. I missed the documented limitation:
_Limitation: Do not use .*) inside the pattern, e.g. $pattern(.*foo(.*)bar.*) does not work, but $pattern(.*foo(.*?)bar.*) does _