title: Insert markers to a string matching a pattern irrespective of case in ruby
body: <p>I am doing a search functionality where I want to highlight the matched pattern. SO, irrespective of the cases, I have to prepend and append all the patterns in the string with a <code>&lt;$&gt;</code> and <code>&lt;/$&gt;</code> respectively.</p>
  
  <pre><code>highlight("RajkumarrAjkumarRAjkumaraj", "Ra") 
  # should return "&lt;$&gt;Ra&lt;/$&gt;jkumar&lt;$&gt;rA&lt;/$&gt;jkumar&lt;$&gt;RA&lt;/$&gt;jkuma&lt;$&gt;ra&lt;/$&gt;j"
  
  highlight("RajkumarrAjkumarRAjkumaraj", "ra") 
  # should return "&lt;$&gt;Ra&lt;/$&gt;jkumar&lt;$&gt;rA&lt;/$&gt;jkumar&lt;$&gt;RA&lt;/$&gt;jkuma&lt;$&gt;ra&lt;/$&gt;j"
  
  highlight("RajkumarrAjkumarRAjkumaraj", "rA") 
  # should return "&lt;$&gt;Ra&lt;/$&gt;jkumar&lt;$&gt;rA&lt;/$&gt;jkumar&lt;$&gt;RA&lt;/$&gt;jkuma&lt;$&gt;ra&lt;/$&gt;j"
  
  highlight("RajkumarrAjkumarRAjkumaraj", "RA") 
  # should return "&lt;$&gt;Ra&lt;/$&gt;jkumar&lt;$&gt;rA&lt;/$&gt;jkumar&lt;$&gt;RA&lt;/$&gt;jkuma&lt;$&gt;ra&lt;/$&gt;j"
  </code></pre>