示例#1
0
        /// <summary>
        /// Negation: Matches any single character that is not in <paramref name="set"/>. By default, the match is case-sensitive.
        /// Pattern: "[^set]".
        /// </summary>
        /// <param name="set">The set of characters to be not matched.</param>
        /// <param name="escape">Indicates whether the character set (\, *, +, ?, |, {, [, (,), ^, $, ., #, and white space) should be replaced with their escape codes.</param>
        /// <exception cref="ArgumentNullException"><paramref name="set"/> is <see langword="null"/></exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="set"/> is <see cref="string.Empty"/>.</exception>
        /// <returns>Current instance of <see cref="Pattern"/>.</returns>
        public Pattern AnyNotIn(string set, bool escape = true)
        {
            var group = new NegativeCharacterGroup(set, escape);

            return(Add(group.ToString(), false));
        }
示例#2
0
        /// <summary>
        /// Character range: Matches any single character that is not in the range from <paramref name="first"/> to <paramref name="last"/>.
        /// Pattern: "[^first-last]".
        /// </summary>
        /// <param name="first">The first character in the range.</param>
        /// <param name="last">The last character in the range.</param>
        /// <param name="caseSensitive">If it must be case-sensitive.</param>
        /// <exception cref="ArgumentException"><paramref name="first"/> is greater as <paramref name="last"/>.</exception>
        /// <returns>Current instance of <see cref="Pattern"/>.</returns>
        public Pattern NotInRange(char first, char last, bool caseSensitive = true)
        {
            var group = new NegativeCharacterGroup(first, last, caseSensitive);

            return(Add(group.ToString(), false));
        }
示例#3
0
        /// <summary>
        /// Character range: Matches any single decimal digit that is not in the range from <paramref name="first"/> to <paramref name="last"/>.
        /// Pattern: "[^first-last]".
        /// </summary>
        /// <param name="first">The first decimal digit in the range.</param>
        /// <param name="last">The last decimal digit in the range.</param>
        /// <exception cref="ArgumentException"><paramref name="first"/> is greater as <paramref name="last"/>.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="first"/> or <paramref name="last"/> are greater as 9.</exception>
        /// <returns>Current instance of <see cref="Pattern"/>.</returns>
        public Pattern NotInRange(uint first, uint last)
        {
            var group = new NegativeCharacterGroup(first, last);

            return(Add(group.ToString(), false));
        }
示例#4
0
        /// <summary>
        /// Negation: Matches any single character that is not in <paramref name="set"/>. By default, the match is case-sensitive.
        /// Pattern: "[^set]".
        /// </summary>
        /// <param name="set">The set of characters to be not matched.</param>
        /// <exception cref="ArgumentNullException"><paramref name="set"/> is <see langword="null"/></exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="set"/> is empty.</exception>
        /// <returns>Current instance of <see cref="Pattern"/>.</returns>
        public Pattern AnyNotIn(params char[] set)
        {
            var group = new NegativeCharacterGroup(set);

            return(Add(group.ToString(), false));
        }