I am not very good at regular expression, but I understand the basics. I am trying to figure out how to make a conditional substitution based on a specific value in a match. For instance:
Suppose I have a nested string structure that looks like this:
"[id value]"
idis some string identifier that names the item [], and valueis another nested item [id value]. Its possible to valuebe empty, but I'm not worried about it yet.
If I have something like this:
A) "[vehicle [toyota camry]]"
or
B) "[animal [dog rufus]]"
I would like to be able to call a specific function (for example, ToString ()) on a basis idthat is inferred as regex.Replace being executed from the innermost structure [].
Transition from the example Pseudocode:
string Return = "{0}";
var 1stValueComboID = GetInteriorValue/IDFrom("[vehicle [toyota camry]]");
Return = Format.String(Return,1stValueIDCombo.ToString());
var 2stValueComboID = GetSecondValue/IDFrom("[vehicle [toyota camry]]");
Return = Format.String(Return,2ndValueIDCombo.ToString());
, , , , , , .