/// <summary>
        /// Initializes a new instance of the <see cref="RegexAssemblyLoaderFilter"/> class.
        /// </summary>
        /// <param name="matchExpression">The expression to match against the assembly name.</param>
        /// <param name="matchTarget">Specifies whether to match the full names or the simple names of assemblies against the
        /// <paramref name="matchExpression"/>.</param>
        public RegexAssemblyLoaderFilter(Regex matchExpression, MatchTargetKind matchTarget)
        {
            ArgumentUtility.CheckNotNull("matchExpression", matchExpression);
            ArgumentUtility.CheckValidEnumValue("matchTarget", matchTarget);

            _matchExpression = matchExpression;
            _matchTarget     = matchTarget;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegexAssemblyLoaderFilter"/> class.
 /// </summary>
 /// <param name="matchExpression">The expression to match against the assembly name. This is converted into a compiled, culture-invariant
 /// regular expression.</param>
 /// <param name="matchTarget">Specifies whether to match the full names or the simple names of assemblies against the
 /// <paramref name="matchExpression"/>.</param>
 public RegexAssemblyLoaderFilter(string matchExpression, MatchTargetKind matchTarget)
     : this(new Regex(
                ArgumentUtility.CheckNotNull("matchExpression", matchExpression),
                // Do not use RegexOptions.Compiled because it takes several 100ms to compile long RegEx which is not offset by the calls made after cache lookups.
                // This is an issue in .NET up to at least version 4.5.1 in x64 mode.
                RegexOptions.CultureInvariant | RegexOptions.Singleline),
            matchTarget)
 {
 }