private static string GetSingleRegExMatch(string inputString,
string regExPattern)
{
string msg;
string result = "";
try
{
Match match = Regex.Match(inputString,
regExPattern,
RegexOptions.Singleline);
if (match.Success)
{
result = match.Value;
}
}
catch (ArgumentException ex)
{
msg = regExPattern;
Debug.WriteLine(ex.InnerException +
" argument exception for pattern " + msg);
}
catch (RegexMatchTimeoutException ex)
{
msg = regExPattern;
Debug.WriteLine(ex.InnerException +
" timeout exception for pattern " + msg);
}
return result;
}