Как разделить строку с помощью regex для достижения: < /p>
string input = "Header aaa, {Type bbb}, ccc";
< /code>
List parameterlist = new List();
Match match = parameterregex.Match(value);
while(match.Success && string.IsNullOrWhiteSpace(match.Value) == false)
{
parameterlist.Add(match.Value);
match = match.NextMatch();
}
return parameterlist.ToArray();
< /code>
output should be something like this
string[] output = [ "Header", "aaa", "{Type bbb}", "ccc"];
< /code>
i tried ([^,]|[^\s])(?![^{]})
i dont really care how the output is produced in the end
Подробнее здесь: https://stackoverflow.com/questions/796 ... ring-split
Мобильная версия