<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Regular Expression matches to a string.</Title>
      <Shortcut>RegularExpressionmatchestoastring.</Shortcut>
      <Description>Regular Expression matches to a string. [C#]</Description>
      <Author>Galen Taylor</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=02ba5b28-e6d6-44be-a79b-1f0d431bfef9</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[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;]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>