title: How to create a repeating non-capturing group?
body: <p>I'm trying to create what I think is a repeating non-capturing group, and I just can't figure out how.</p>
  
  <p>In plain words, I want to match:</p>
  
  <p>Any number which is both</p>
  
  <ul>
  <li>Preceded by any amount of blocks that doesn't contain a space, but is not either just a number.</li>
  <li>Followed by any amount of blocks that doesn't contain a space, but is not either just a number.</li>
  </ul>
  
  <p><a href="https://regex101.com/r/100hA4/2" rel="nofollow noreferrer">Here</a> is what I tried:</p>
  
  <p>Pattern: (?:\w.)+(\d+)(?:.\w+)+</p>
  
  <p>Test Set:</p>
  
  <pre><code>3.AAA
  AAA.BBB
  AAA.3.BBB
  AAA.3.B555B
  AAA.3.BBB.4
  AAA.3.BBB.4.CCC
  AAA.3.BBB.CCC
  AAA.3.BBB.CCC.4
  AAA.3.BBB.CCC.4.DDD
  ZZZ.AAA.3.BBB
  ZZZ.AAA.3.BBB.4
  ZZZ.AAA.3.BBB.4.CCC
  ZZZ.AAA.3.BBB.CCC
  ZZZ.AAA.3.BBB.CCC.4
  ZZZ.AAA.3.BBB.CCC.4.DDD
  </code></pre>
  
  <p>I would want it to match only to:</p>
  
  <pre><code>AAA.3.BBB
  AAA.3.B555B
  AAA.3.BBB.CCC
  ZZZ.AAA.3.BBB
  ZZZ.AAA.3.BBB.CCC
  </code></pre>
  
  <p>Note: I saw some other posts asking the same-ish question, but I can't use the answers because they were all like "Instead of trying to repeat a group, just match 'this' and it will work for your specific case".</p>