c#.net 정규표현식 글자비교
void main()
{
String[] Source = {"abcd","efgh"};
String FindStr = "cd";
compareString( Source, FindStr );
}
private bool compareString(String[] order, String word)
{
foreach (string s in order)
{
//System.Console.Write("{0,24}", s);
if (System.Text.RegularExpressions.Regex.IsMatch(s, word, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
//System.Console.WriteLine(" (match for '{0}' found)", word);
return true;
}
}
return false;
}
private bool compareString(String order, String word)
{
if (System.Text.RegularExpressions.Regex.IsMatch(order, word, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
return true;
}
return false;
}