A simple optional word.
ID: 790
See: Optional parts
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("This is a [very] important test", "MATCHED");
// Matches with the optional word
Console.WriteLine(t.Transform("This is a very important test"));
// Also matches without the optional word
Console.WriteLine(t.Transform("This is a important test"));
MATCHED
MATCHED using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("This is a [very] important test", "MATCHED"); // Matches with the optional word Console.WriteLine(t.Transform("This is a very important test")); // Also matches without the optional word Console.WriteLine(t.Transform("This is a important test"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("This is a [very] important test", "MATCHED");
// Matches with the optional word
cout << t.Transform("This is a very important test") << endl;
// Also matches without the optional word
cout << t.Transform("This is a important test") << endl;
}
MATCHED
MATCHED #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("This is a [very] important test", "MATCHED"); // Matches with the optional word cout << t.Transform("This is a very important test") << endl; // Also matches without the optional word cout << t.Transform("This is a important test") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("This is a [very] important test", "MATCHED")
'// Matches with the optional word
Console.WriteLine(t.Transform("This is a very important test"))
'// Also matches without the optional word
Console.WriteLine(t.Transform("This is a important test"))
End Sub
End Module
MATCHED
MATCHED Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("This is a [very] important test", "MATCHED") '// Matches with the optional word Console.WriteLine(t.Transform("This is a very important test")) '// Also matches without the optional word Console.WriteLine(t.Transform("This is a important test")) End Sub End Module