Regex regex = new Regex(@"<body[^>]*>(.*?)</body>", RegexOptions.IgnoreCase | RegexOptions.Singleline); Match match = regex.Match(text); if (match.Success) { body = match.Groups[1].Value; }