I use following piece of code to convert the string to SENTENCE Case.
var sentenceRegex = new Regex(@"(^[a-z])|[?!.:;]\s+(.)", RegexOptions.ExplicitCapture);
var result = sentenceRegex.Replace(toConvert.ToLower(), s => s.Value.ToUpper());
However it fails in-cases when the Sentence starts with HTML_TAGS as shown in the example below.
I want to skip the HTML Tags and convert the text to SENTENCE CASE. Current Text :
<BOLD_HTML_TAG>lorem ipsum is simply dummy</BOLD_HTML_TAG> text of the printing and typesetting industry.
<PARAGRAPH_TAG>LOREM ipsum has been the industry's standard dummy
textever since the 1500s</PARAGRAPH_TAG>.
After Sentence Casing Output Should be as follows :
<BOLD_HTML_TAG>Lorem ipsum is simply dummy</BOLD_HTML_TAG> text of the
printing and typesetting industry. <PARAGRAPH_TAG>Lorem ipsum has been
the industry's standard dummy textever since the
1500s</PARAGRAPH_TAG>.
I would appreciate if someone can help me the regex I should be using to ignore(not remove it) the HTML tags from the string and convert the string to SENTENCE CASE.