If I have a string in this format:
string placeholder = "[[Ford:Focus(blue)]]";
What regex could I use to populate the three variables below?
string make = ?
string model = ?
string colour = ?
Any ideas?
Thanks,
string input = "[[Ford:Focus(blue)]]";
var parts = Regex.Matches(input, @"\w+").Cast<Match>().Select(x => x.Value).ToList();
var make = parts[0];
....
OR
var match = Regex.Match(input, @"\[\[(\w+):(\w+)\((\w+)\)\]\]");
var make = match.Groups[1].Value;
var model = match.Groups[2].Value;
....
\w* instead of \w+.Length of parts, for the 2nd, you should give a sample input\w+ with [a-zA-Z ]+