コード例 #1
0
        protected static string SubstituteUsingRegex(Regex regex, string text)
        {
            var matches = regex.Matches(text);
            var result  = PunctuationReplacer.Replace(text, matches);

            return(result);
        }
コード例 #2
0
        private string SubstitutePunctuationBetweenDoubleQuotes(string text)
        {
            var matches = GetTextBetweenDoubleQuotes(text);
            var result  = PunctuationReplacer.Replace(text, matches);

            return(result);
        }
コード例 #3
0
        public static string Apply(string input)
        {
            var matches = ExclamationRegex.Matches(input);

            var result = PunctuationReplacer.Replace(input, matches);

            return(result);
        }
コード例 #4
0
        private static string SubstitutePunctuationBetweenSingleQuotes(string txt)
        {
            if (WordWithLeadingApostrophe.IsMatch(txt) && !SpaceFollowingApostropheRegex.IsMatch(txt))
            {
                return(txt);
            }

            var matches = BetweenSingleQuotesRegex.Matches(txt);
            var result  = PunctuationReplacer.Replace(txt, matches, PunctuationReplacerType.Single);

            return(result);
        }