Exemplo n.º 1
0
        /// <summary>
        /// Appends a pattern that matches a character from a specified base group except characters from a specified excluded group.
        /// </summary>
        /// <param name="baseGroup">A base group.</param>
        /// <param name="excludedGroup">An excluded group.</param>
        /// <exception cref="ArgumentNullException"><paramref name="baseGroup"/> or <paramref name="excludedGroup"/> is <c>null</c>.</exception>
        public void AppendSubtraction(IBaseGroup baseGroup, IExcludedGroup excludedGroup)
        {
            if (baseGroup == null)
                throw new ArgumentNullException(nameof(baseGroup));

            if (excludedGroup == null)
                throw new ArgumentNullException(nameof(excludedGroup));

            AppendCharGroupStart();

            baseGroup.AppendBaseGroupTo(this);

            AppendDirect('-');

            excludedGroup.AppendExcludedGroupTo(this);

            AppendCharGroupEnd();
        }