Ejemplo n.º 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));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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());
Ejemplo n.º 4
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the entire match.
 /// </summary>
 public Substitution EntireMatch() => Append(Substitutions.EntireMatch());
Ejemplo n.º 5
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the entire input string.
 /// </summary>
 public Substitution EntireInput() => Append(Substitutions.EntireInput());
Ejemplo n.º 6
0
 /// <summary>
 /// Appends a substitution pattern that substitutes the last captured group.
 /// </summary>
 public Substitution LastCapturedGroup() => Append(Substitutions.LastCapturedGroup());
Ejemplo n.º 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));
Ejemplo n.º 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));
Ejemplo n.º 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));
Ejemplo n.º 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));
Ejemplo n.º 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());