title: Regex to remove underscore followed by number in string in python?
body: <p>I have set of strings like this:</p>
  
  <pre><code>CLM_ADJUSTMT.CLAIM_DATA.TUDCAP_L_2.CRT_TS_0, 
  marks.science_0.physics_0,
  marks.geo_1
  </code></pre>
  
  <p>I want to remove only if underscore is followed by number(CRT_TS_0=CRT_TS)
  can someone help me to get the right regex</p>
  
  <p>I tried using</p>
  
  <pre><code>  re.sub('_[0-9]+$', '',newstr)
  </code></pre>
  
  <p>but it removes all underscore and numbers</p>
  
  <p>output:</p>
  
  <pre><code>CLM_ADJUSTMT.CLAIM_DATA.TUDCAP_L.CRT_TS,
  marks.science.physics,
  marks.geo
  </code></pre>