title: How to find and replace for ranges with gsub
body: <p>I have text as follows:</p>
  
  <pre><code>".OESOPHAGUS: inflammation. STOMACH: Lots of information here.DUODENUM: Some more information. ENDOSCOPIC DIAGNOSIS blabla"
  </code></pre>
  
  <p>I would like to replace any full stop followed by a letter (upper or lower case) to be replaced by a full stop, newline and then the letter. so that the output should be:</p>
  
  <pre><code>".\nOESOPHAGUS: inflammation. .\nSTOMACH: Lots of information here. .\nDUODENUM: Some more information. .\nENDOSCOPIC DIAGNOSIS blabla"
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>gsub("\\..*?([A-Za-z])","\\.\n\\1",MyData$Algo)
  </code></pre>
  
  <p>but this gives me:</p>
  
  <pre><code>.\nESOPHAGUS: inflammation.\nTOMACH: Lots of information here.DUODENUM: Some more information.\nNDOSCOPIC DIAGNOSIS blabla"
  </code></pre>
  
  <p>The problem seems to be in the matching of ranges as specified. Is there a way to do this find-replace. I am not reliant on gsub.</p>