CodeExpression CreateEvalInvokeExpression (Regex regex, string value, bool isBind)
{
Match match = regex.Match (value);
if (!match.Success) {
if (isBind)
throw new HttpParseException ("Bind invocation wasn't formatted properly.");
return null;
}
string sanitizedSnippet;
if (isBind)
sanitizedSnippet = SanitizeBindCall (match);
else
sanitizedSnippet = value;
return new CodeSnippetExpression (sanitizedSnippet);
}