Internal Test: Combines `@StartAfter` and `@StopAfter` to retrieve a specific 'page' of results (matches 3 through 7).

ID: 993

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
t.Text = "1 2 3 4 5 6 7 8 9 10 11 12";
var rule = t.Pattern("{@Number}");

// Get a "page" of results: matches 3 through 7.
// The engine will stop finding numbers after the 7th match is found.
// Then, it will skip the first 2 matches from that set.
rule.StartAfter = 2; // Skip first 2
rule.StopAfter = 7;  // Find up to 7

t.Find();

Console.WriteLine("Matches found:");
Console.WriteLine(t.Matches.Text);
				
			
Matches found:
3
4
5
6
7
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.Text("1 2 3 4 5 6 7 8 9 10 11 12");
   auto rule = t.Pattern("{@Number}");

   // Get a "page" of results: matches 3 through 7.
   // The engine will stop finding numbers after the 7th match is found.
   // Then, it will skip the first 2 matches from that set.
   rule.StartAfter(2); // Skip first 2
   rule.StopAfter(7);  // Find up to 7

   t.Find();

   cout << "Matches found:" << endl;
   cout << t.Matches().Text() << endl;
}
				
			
Matches found:
3
4
5
6
7
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      t.Text = "1 2 3 4 5 6 7 8 9 10 11 12"
      Dim rule = t.Pattern("{@Number}")
      
      '// Get a "page" of results: matches 3 through 7.
      '// The engine will stop finding numbers after the 7th match is found.
      '// Then, it will skip the first 2 matches from that set.
      rule.StartAfter = 2 '// Skip first 2
      rule.StopAfter = 7  '// Find up to 7
      
      t.Find()
      
      Console.WriteLine("Matches found:")
      Console.WriteLine(t.Matches.Text)
   End Sub
End Module
				
			
Matches found:
3
4
5
6
7