I have an input string as follows:
var format = "{0}({1:2}({*:8})){2:3}({3:16})";
For the "what are you doing this for" questions:
What the above format is telling us is much like the string.Format(string, args)
method with some modifications.
- {0} is an insert index
- {1:2} is an insert index with specified length in bytes
- ({3:16}) is a grouped insert index which retains a copy of the matching sequence
Expected graph of output:
- {0}
- ({1:2}({*:8}))
- {2:3}
- ({3:16})
What I'm getting now:
- {0}
- ({1:2}
- ({*:8}))
- {2:3}
- ({3:16})
The regular expression I'm working with now:
var regExpr = @"\(?\{\(*([^/}]+)\)*\}\)?";
As an aside, since I am just now learning RegEx
I expect comments about the efficiency of the expression.