예제 #1
0
        /// <summary>
        /// Replaces the token from the buffer between the provided tokens
        /// </summary>
        /// <param name="buffer">Buffer to update</param>
        /// <param name="rpBetweenToken">replacement token</param>
        public virtual void ReplaceBetweenTokens(ref string buffer, ReplaceBetweenPairToken rpBetweenToken)
        {
            string regularExp = rpBetweenToken.TokenStart + "[^" + rpBetweenToken.TokenIdentifier + "]*" + rpBetweenToken.TokenEnd;

            buffer = System.Text.RegularExpressions.Regex.Replace(buffer, regularExp, rpBetweenToken.TokenReplacement);
        }
 /// <summary>
 /// Replaces the token from the buffer between the provided tokens
 /// </summary>
 /// <param name="buffer">Buffer to update</param>
 /// <param name="rpBetweenToken">replacement token</param>
 public virtual void ReplaceBetweenTokens(ref string buffer, ReplaceBetweenPairToken rpBetweenToken)
 {
     string regularExp = rpBetweenToken.TokenStart + "[^" + rpBetweenToken.TokenIdentifier + "]*" + rpBetweenToken.TokenEnd;
     buffer = System.Text.RegularExpressions.Regex.Replace(buffer, regularExp, rpBetweenToken.TokenReplacement);
 }