I need to insert a word after every X (i.e. 4,5,6 etc) sentences in given text. I feel regex would be compact and good solution. To be specific, I need to do this in .net.
Thanks,
Mihir
(If regex can’t identify some sentences ending with not so common punctuation, I am fine with it. I don’t need 100% accuracy)
You can only do it with the Regex in .NET if you find a match and loop through the string as long as you find new matches. Of course this is no regex-only implementation:
Maybe this woul help you implementing it in .NET although there are several other ways to do it.