Extracting keys from a key-value list where keys must be identifiers.
ID: 250
See: {@Alphanumeric}, Introduction
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
// Capture the alphanumeric key and any literal value
t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]");
var input = "Timeout = 100; User = 'Admin'";
Console.WriteLine(t.Transform(input));
KEY:[Timeout] VAL:[100]; KEY:[User] VAL:['Admin'] using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); // Capture the alphanumeric key and any literal value t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]"); var input = "Timeout = 100; User = 'Admin'"; Console.WriteLine(t.Transform(input));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto t = uc.NewTransformer();
// Capture the alphanumeric key and any literal value
t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]");
auto input = "Timeout = 100; User = 'Admin'";
cout << t.Transform(input) << endl;
}
KEY:[Timeout] VAL:[100]; KEY:[User] VAL:['Admin'] #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); // Capture the alphanumeric key and any literal value t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]"); auto input = "Timeout = 100; User = 'Admin'"; cout << t.Transform(input) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
'// Capture the alphanumeric key and any literal value
t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]")
Dim input = "Timeout = 100; User = 'Admin'"
Console.WriteLine(t.Transform(input))
End Sub
End Module
KEY:[Timeout] VAL:[100]; KEY:[User] VAL:['Admin'] Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() '// Capture the alphanumeric key and any literal value t.FromTo("{@Alpha:key} = {@Literal:val}", "KEY:[{key}] VAL:[{val}]") Dim input = "Timeout = 100; User = 'Admin'" Console.WriteLine(t.Transform(input)) End Sub End Module