Matching a certain number of tokens

ID: 200

See: Tokens
				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
t.FromTo("is {TokenCount:4}", "is <{TokenCount}>");
Console.WriteLine("This example captures 4 tokens");
Console.WriteLine(t.Transform("This is just a small token match test"));

// Quoted text counts as one token
Console.WriteLine(t.Transform("This is a 'really really' small test with quoted text"));
				
			
This example captures 4 tokens
This is <just a small token> match test
This is <a 'really really' small test> with quoted text
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.FromTo("is {TokenCount:4}", "is <{TokenCount}>");
   cout << "This example captures 4 tokens" << endl;
   cout << t.Transform("This is just a small token match test") << endl;

   // Quoted text counts as one token
   cout << t.Transform("This is a 'really really' small test with quoted text") << endl;
}
				
			
This example captures 4 tokens
This is <just a small token> match test
This is <a 'really really' small test> with quoted text
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      t.FromTo("is {TokenCount:4}", "is <{TokenCount}>")
      Console.WriteLine("This example captures 4 tokens")
      Console.WriteLine(t.Transform("This is just a small token match test"))
      
      '// Quoted text counts as one token
      Console.WriteLine(t.Transform("This is a 'really really' small test with quoted text"))
   End Sub
End Module
				
			
This example captures 4 tokens
This is <just a small token> match test
This is <a 'really really' small test> with quoted text