MatchCollection match = Regex.Matches( fileText, pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline );
if( match.Count > 0 )
{
StringBuilder sb = new StringBuilder();
IEnumerator m = match.GetEnumerator();
for( int i = 0; i < match.Count; ++i )
{
sb.AppendFormat("{0}\n",match[i].Value.Trim());
}
return sb.ToString();
}
else
return String.Empty;
|