title: regular expression to replace sub pattern 'hello1, 2, 3' with 'hello' without affecting other numbered patterns
body: <p>Apologies I'm inexperienced with regular expressions</p>
  
  <p>I want to get rid of all the sub-patterns in a string that are characterised by having a number straight after a word ('hello1') and or having a series of numbers after the word ('hello1, 2, 3') and to replace this pattern with just the original word (hello).</p>
  
  <p>Below I have text:</p>
  
  <blockquote>
    <p>x='interspersed by 1,6-hexanediol, corresponds to the immobile
    component observed with FRAP. Consistent with this idea, the immobile
    fraction of HP 1a.... own to arise through phase separation23. N&amp;B
    analysis of GFP–fibrillarin highlighted areas of consistently high
    variance (2.38 ± 0.46 -mers) at the nucleolar boundary, compared to
    inside (1.28 ± 0.36) or outside (1.17 ± 0.25) the domain24, 25, 26.
    Similarly, GFP–HP 1a displayed increased variance34, 37'</p>
  </blockquote>
  
  <pre><code>x =re.sub(r'([^ 0-9])(\d+(?:, \d+)*)', r'\1', x)
  </code></pre>
  
  <p>Above I use a regular expression to get rid of the patterns with numbers immediately proceeding a word however it also give un-intended effects:</p>
  
  <blockquote>
    <p>interspersed by 1,-hexanediol, corresponds to the immobile component
    observed with FRAP. Consistent with this idea, the immobile fraction
    of HP 1a.... own to arise through phase separation. N&amp;B analysis of
    GFP\xe2\x80\x93fibrillarin highlighted areas of consistently high
    variance (.\xe2\x80\x89\xc2\xb1\xe2\x80\x89. -mers) at the nucleolar
    boundary, compared to inside (.\xe2\x80\x89\xc2\xb1\xe2\x80\x89.) or
    outside (.\xe2\x80\x89\xc2\xb1\xe2\x80\x89.) the domain. Similarly,
    GFP\xe2\x80\x93HP 1a displayed increased variance</p>
  </blockquote>
  
  <p>The intended output is:</p>
  
  <blockquote>
    <p>x='interspersed by 1,6-hexanediol, corresponds to the immobile
    component observed with FRAP. Consistent with this idea, the immobile
    fraction of HP 1a.... own to arise through phase separation. N&amp;B
    analysis of GFP–fibrillarin highlighted areas of consistently high
    variance (2.38 ± 0.46 -mers) at the nucleolar boundary, compared to
    inside (1.28 ± 0.36) or outside (1.17 ± 0.25) the domain.
    Similarly, GFP–HP 1a displayed increased variance'</p>
  </blockquote>
  
  <p>patterns such as '1,6-hexanediol', '1.28 ± 0.36' and 'HP 1a' are kept without removing the numbers</p>
  
  <p>UPDATE:</p>
  
  <p>The expression seems to fail to fully get rid of patterns containing a hyphen (e.g. word11-12).</p>
  
  <pre><code>x='than allelic variant and define eQTLs9–11'
  
  x = re.sub(r"(?&lt;=\w)\d+(?:, \d+)*", "", x)
  </code></pre>
  
  <p>results in</p>
  
  <blockquote>
    <p>than allelic variant and define eQTLs–1</p>
  </blockquote>
  
  <p>expected output:</p>
  
  <blockquote>
    <p>than allelic variant and define eQTLs</p>
  </blockquote>
  
  <p>can anyone help me achieve this?</p>