#region tag find function private string TagFind(string sourse, string left, string right, int startIndex, bool greedy) { int p = sourse.IndexOf(left, startIndex); if (p == -1) return string.Empty; int start = p + left.Length; int t; if (greedy) t = sourse.LastIndexOf(right); else t = sourse.IndexOf(right, start); if (t == -1) return string.Empty; return (sourse.Substring(start, t - start)); } #endregion