private static void SetUpVars(string filterValue,
ref string filterStr,
ref Regex filterRegEx,
bool ignoreCase)
{
RegexOptions opts = RegexOptions.None;
if (ignoreCase) opts = opts | RegexOptions.IgnoreCase;
filterStr = filterValue != null ? filterValue.Trim() : string.Empty;
try
{
filterRegEx = new Regex(filterStr, opts);
}
catch (ArgumentException)
{
filterRegEx = null;
}
}