title: How do I replace hyphen (-) with space in a string except for the matched pattern in a string?
body: <p>I have strings similar to</p>
  
  <pre><code>text='Studied b-tech from college in 2010-13'
  </code></pre>
  
  <p>Using</p>
  
  <pre><code>text.replace('-', ' ')
  </code></pre>
  
  <p>will produce</p>
  
  <pre class="lang-none prettyprint-override"><code>Studied b tech from college in 2010 13
  </code></pre>
  
  <p>But what I want is:</p>
  
  <pre class="lang-none prettyprint-override"><code>Studied b tech from college in 2010-13
  </code></pre>
  
  <p>I have prepared below pattern for grepping tokens like <code>2010-13</code>, but how do I use it in my code?</p>
  
  <pre><code>regex_pattern='(\d{4}-\d{2,4})'
  </code></pre>