// Текст для обработки
string text = project.ExecuteMacro(project.Variables["otvet"].Value);
var errorIfEmpty = false;
var regexGroups = Macros.TextProcessing.Regex(text, @"(?<=number":").*(?=","response)", "0");
if (regexGroups.Count == 0)
{
if (errorIfEmpty) throw new Exception();
}
else
{
project.Variables["phone"].Value = regexGroups[0].FirstOrDefault();
}