Question
How would be the pattern to extract a chunk of text between two arbitrary words that may or not be in the same line. For example:
Welcome to TWiki, a flexible, powerful,
and easy to use Web-based collaboration platform.
Use TWiki to run a project development space,
a document management system,
a knowledge base, or
any other groupware tool, on an intranet or on the internet.
Letīs say I want the text between powerful and tool including both words
powerful,
and easy to use Web-based collaboration platform.
Use TWiki to run a project development space,
a document management system,
a knowledge base, or
any other groupware tool
Environment
--
AntonioVega - 09 Oct 2003
Answer
Do an INCLUDE with a pattern; the pattern search goes over multiple lines. Here is how to grab the text from your example on this topic:
%INCLUDE{ "%TOPIC%" pattern="^.*?(powerful.*?tool).*" }%
does this:
|
powerful,
and easy to use Web-based collaboration platform.
Use TWiki to run a project development space,
a document management system,
a knowledge base, or
any other groupware tool
|
IncludeTopicsAndWebPages has more.
--
PeterThoeny - 26 Oct 2003