/// <summary>
/// 获取属性
/// </summary>
/// <param name="str">配置字符串</param>
/// <param name="title">title</param>
/// <param name="attribute">属性名称</param>
/// <returns>值 缺省返回string.empty</returns>
public static string GetAttribute(string str, string title, string attribute)
{
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(attribute)) return string.Empty;
if (title == null) title = string.Empty;
string regexStr = string.Format("<{0}[^>]*? {1}[\\s]*?=[\\s]*?(['\"\"]?)(?<value>[^'\"\"\\s>]+)\\1[^>]*>", title, attribute); //获取<title>之间内容
Match TitleMatch = Regex.Match(str, regexStr, RegexOptions.IgnoreCase);
return TitleMatch.Groups["value"].Value;
}