title: How to backreference in Ruby regular expression (regex) with gsub when I use grouping?
body: <p>I would like to patch some text data extracted from web pages.
  sample:</p>
  
  <pre><code>t="First sentence. Second sentence.Third sentence."
  </code></pre>
  
  <p>There is no space after the point at the end of the second sentence. This sign me that the 3rd sentence was in a separate line (after a br tag) in the original document.</p>
  
  <p>I want to use this regexp to insert "\n" character into the proper places and patch my text.
  My regex: </p>
  
  <pre><code>t2=t.gsub(/([.\!?])([A-Z1-9])/,$1+"\n"+$2)
  </code></pre>
  
  <p>But unfortunately it doesn't work: "NoMethodError: undefined method `+' for nil:NilClass"
  How can I properly backreference to the matched groups?
  It was so easy in Microsoft Word, I just had to use \1 and \2 symbols.</p>