コード例 #1
0
        /// <summary>
        /// Concatenate two elements into a new <see cref="Substitution"/>.
        /// </summary>
        /// <param name="left">The first element to concatenate.</param>
        /// <param name="right">The second element to concatenate.</param>
        /// <exception cref="ArgumentNullException"><paramref name="right"/> is <c>null</c>.</exception>
        public static Substitution operator +(char left, Substitution right)
        {
            if (right == null)
            {
                throw new ArgumentNullException(nameof(right));
            }

            return(Substitutions.Text(left).Append(right));
        }
コード例 #2
0
        /// <summary>
        /// Concatenate two elements into a new <see cref="Substitution"/>.
        /// </summary>
        /// <param name="left">The first element to concatenate.</param>
        /// <param name="right">The second element to concatenate.</param>
        /// <exception cref="ArgumentNullException"><paramref name="left"/> is <c>null</c>.</exception>
        public static Substitution operator +(Substitution left, char right)
        {
            if (left == null)
            {
                throw new ArgumentNullException(nameof(left));
            }

            return(left.Append(Substitutions.Text(right)));
        }
コード例 #3
0
 /// <summary>
 /// Appends a substitution pattern that substitutes all the text of the input string after the match.
 /// </summary>
 public Substitution AfterMatch() => Append(Substitutions.AfterMatch());
コード例 #4
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the entire match.
 /// </summary>
 public Substitution EntireMatch() => Append(Substitutions.EntireMatch());
コード例 #5
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the entire input string.
 /// </summary>
 public Substitution EntireInput() => Append(Substitutions.EntireInput());
コード例 #6
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the last captured group.
 /// </summary>
 public Substitution LastCapturedGroup() => Append(Substitutions.LastCapturedGroup());
コード例 #7
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the last substring matched by the named group.
 /// </summary>
 /// <param name="groupName">Valid regex group name.</param>
 /// <exception cref="ArgumentNullException"><paramref name="groupName"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentException"><paramref name="groupName"/> is not a valid regex group name.</exception>
 public Substitution NamedGroup(string groupName) => Append(Substitutions.NamedGroup(groupName));
コード例 #8
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the last substring matched by the numbered or named group.
 /// </summary>
 /// <param name="groupNumber">A number of the group.</param>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="groupNumber"/> is less than zero.</exception>
 public Substitution Group(int groupNumber) => Append(Substitutions.Group(groupNumber));
コード例 #9
0
 /// <summary>
 /// Appends a specified character to the substitution pattern.
 /// </summary>
 /// <param name="value">A Unicode character to append.</param>
 public Substitution Text(char value) => Append(Substitutions.Text(value));
コード例 #10
0
 /// <summary>
 /// Appends a specified text to the substitution pattern.
 /// </summary>
 /// <param name="value">A text to append.</param>
 public Substitution Text(string value) => Append(Substitutions.Text(value));
コード例 #11
0
 /// <summary>
 /// Appends a substitution pattern that substitutes all the text of the input string before the match.
 /// </summary>
 public Substitution BeforeMatch() => Append(Substitutions.BeforeMatch());