anchors, then by default, the search scope for the
Content
is the segment between the
Marker
anchors.
If you change all the anchors to the same phase, the search scope of the
Content
is no longer bounded by the second
Marker
. It is from the end of the first
Marker
to the end of the document.
As an example, consider the following source document:
Tree Fig Date<tab>October 27, 2003 (pruned)
Tree Date Palm Date April 27, 2003<tab>(planted)
The example assumes that the source document has a loose structure, containing varying numbers of spaces, tabs, or other symbols interspersed in the text, so we cannot easily use the spaces and tabs as delimiters. An example like this might arise in parsing word-processor documents.
We can parse this document using a
RepeatingGroup
anchor, which contains nested
Marker
and
Content
anchors. The
Marker
anchors are the strings
Tree
and
Date
. The
Content
anchors are everything between the
Marker
anchors, including the spaces and tabs.
The problem in parsing this document is in the second iteration of the
RepeatingGroup
, which parses the second line. If we leave the
Marker
anchors in the initial phase, the Script incorrectly considers the first instance of the word
Date
to be a
Marker
. In the main phase, it fails to find
Date Palm
because the search scope is between the two
Marker
anchors, and there is no text between them.
A possible solution is to move the
Marker
for
Date
to the main phase, and to define the
Content
anchor,
Date Palm
, using an expression that searches for a tree name of one or two words. In the initial phase of the
RepeatingGroup
, the Script finds the
Marker
for
Tree
. In the main phase, it finds
Date Palm
followed by the
Marker
for
Date
.
With the new phase setting, we have changed the search scope for the tree name. The scope is now from