Focusable to toggle pattern matches
ID: 123
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
t.Str("Title
Bold statementTitle B
Other text");
var BoldTag = t.Pattern("{text}").SetFocusable(true);
var H3Tag = t.Pattern("{text}
").SetFocusable(true);
t.Find();
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text);
Console.WriteLine("");
BoldTag.Focusable = false;
Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}");
Console.WriteLine("--------------------------");
// t.Find(); // A Find operation does not have to be executed again
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text);
Console.WriteLine("");
BoldTag.Focusable = true;
Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}");
Console.WriteLine("--------------------------");
//t.Find(); // A Find operation does not have to be executed again
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text);
Console.WriteLine("");
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b>
BoldTag.Focusable(): False
--------------------------
<h3>Title</h3>
<h3>Title B</h3>
BoldTag.Focusable(): True
--------------------------
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b> using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); t.Str("<h3>Title</h3><b>Bold statement</b><h3>Title B</h3><b>Other text</b>"); var BoldTag = t.Pattern("<b>{text}</b>").SetFocusable(true); var H3Tag = t.Pattern("<h3>{text}</h3>").SetFocusable(true); t.Find(); Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text); Console.WriteLine(""); BoldTag.Focusable = false; Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}"); Console.WriteLine("--------------------------"); // t.Find(); // A Find operation does not have to be executed again Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text); Console.WriteLine(""); BoldTag.Focusable = true; Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}"); Console.WriteLine("--------------------------"); //t.Find(); // A Find operation does not have to be executed again Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text); Console.WriteLine("");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
auto t = uc.NewTransformer();
t.Str("Title
Bold statementTitle B
Other text");
auto BoldTag = t.Pattern("{text}").SetFocusable(true);
auto H3Tag = t.Pattern("{text}
").SetFocusable(true);
t.Find();
cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl;
cout << "" << endl;
BoldTag.Focusable(false);
cout << "BoldTag.Focusable(): " << tf(BoldTag.Focusable()) << endl;
cout << "--------------------------" << endl;
// t.Find(); // A Find operation does not have to be executed again
cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl;
cout << "" << endl;
BoldTag.Focusable(true);
cout << "BoldTag.Focusable(): " << tf(BoldTag.Focusable()) << endl;
cout << "--------------------------" << endl;
//t.Find(); // A Find operation does not have to be executed again
cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl;
cout << "" << endl;
}
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b>
BoldTag.Focusable(): False
--------------------------
<h3>Title</h3>
<h3>Title B</h3>
BoldTag.Focusable(): True
--------------------------
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b> #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; auto t = uc.NewTransformer(); t.Str("<h3>Title</h3><b>Bold statement</b><h3>Title B</h3><b>Other text</b>"); auto BoldTag = t.Pattern("<b>{text}</b>").SetFocusable(true); auto H3Tag = t.Pattern("<h3>{text}</h3>").SetFocusable(true); t.Find(); cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl; cout << "" << endl; BoldTag.Focusable(false); cout << "BoldTag.Focusable(): " << tf(BoldTag.Focusable()) << endl; cout << "--------------------------" << endl; // t.Find(); // A Find operation does not have to be executed again cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl; cout << "" << endl; BoldTag.Focusable(true); cout << "BoldTag.Focusable(): " << tf(BoldTag.Focusable()) << endl; cout << "--------------------------" << endl; //t.Find(); // A Find operation does not have to be executed again cout << t.GetMatches(MatchesOption::FocusableOnly).Text() << endl; cout << "" << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
t.Str("Title
Bold statementTitle B
Other text")
Dim BoldTag = t.Pattern("{text}").SetFocusable(true)
Dim H3Tag = t.Pattern("{text}
").SetFocusable(true)
t.Find()
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text)
Console.WriteLine("")
BoldTag.Focusable = false
Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}")
Console.WriteLine("--------------------------")
'// t.Find(); // A Find operation does not have to be executed again
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text)
Console.WriteLine("")
BoldTag.Focusable = true
Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}")
Console.WriteLine("--------------------------")
'//t.Find(); // A Find operation does not have to be executed again
Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text)
Console.WriteLine("")
End Sub
End Module
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b>
BoldTag.Focusable(): False
--------------------------
<h3>Title</h3>
<h3>Title B</h3>
BoldTag.Focusable(): True
--------------------------
<h3>Title</h3>
<b>Bold statement</b>
<h3>Title B</h3>
<b>Other text</b> Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() t.Str("<h3>Title</h3><b>Bold statement</b><h3>Title B</h3><b>Other text</b>") Dim BoldTag = t.Pattern("<b>{text}</b>").SetFocusable(true) Dim H3Tag = t.Pattern("<h3>{text}</h3>").SetFocusable(true) t.Find() Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text) Console.WriteLine("") BoldTag.Focusable = false Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}") Console.WriteLine("--------------------------") '// t.Find(); // A Find operation does not have to be executed again Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text) Console.WriteLine("") BoldTag.Focusable = true Console.WriteLine($"BoldTag.Focusable(): {BoldTag.Focusable}") Console.WriteLine("--------------------------") '//t.Find(); // A Find operation does not have to be executed again Console.WriteLine(t.GetMatches(MatchesOption.FocusableOnly).Text) Console.WriteLine("") End Sub End Module