private PublisherFilter(FilterType filterType, string text)
{
if (string.IsNullOrWhiteSpace(text))
throw new ArgumentNullException(nameof(text), "cannot be null or whitespace");
if (filterType != FilterType.Assembly && filterType != FilterType.Type)
throw new InvalidEnumArgumentException(nameof(filterType), (int)filterType, typeof(FilterType));
m_filterType = filterType;
m_text = text;
m_isExpression = text.Contains('*') || text.Contains('?');
m_regexMatch = null;
if (m_isExpression)
{
var regexMatchString = "^" + Regex.Escape(text).Replace("\\*", ".*").Replace("\\?", ".") + "$";
m_regexMatch = new Regex(regexMatchString, RegexOptions.Compiled);
}
}