protected static string SubstituteUsingRegex(Regex regex, string text) { var matches = regex.Matches(text); var result = PunctuationReplacer.Replace(text, matches); return(result); }
private string SubstitutePunctuationBetweenDoubleQuotes(string text) { var matches = GetTextBetweenDoubleQuotes(text); var result = PunctuationReplacer.Replace(text, matches); return(result); }
public static string Apply(string input) { var matches = ExclamationRegex.Matches(input); var result = PunctuationReplacer.Replace(input, matches); return(result); }
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); }