title: Isolating sizes written in various ways while maintaining it in group 1
body: <p>Wiktor helped me to isolate values when i had multiple sizes:</p>
  <p><code>(?i)([a-z\d]+(?:[/-][a-z\d]+)?)[/-]([a-z\d]+(?:[/-][a-z\d]+)?)</code></p>
  <p>However i was unable to look into how it could handle a single size all together</p>
  <p>Test cases:</p>
  <pre><code>S1 - XXS/XS-S/M
  S1 - 40-42-36-38
  XXS/XS
  40-42
  40
  </code></pre>
  <p>With the above examples i am able to match all the relevant sizes, but not the last one &quot;40&quot;</p>
  <p>How could i look into grabbing this value as well if its a single value. However it seems that won't be doable with the current.</p>
  <p>So i have been wondering if it perhaps could be possible to grab the higlighted so that i always get the result of the first size in group 1</p>
  <p><strong>S1 - XXS/XS</strong>-S/M</p>
  <p><strong>S1 - 40-42</strong>-36-38</p>
  <p><strong>XXS</strong>/XS</p>
  <p><strong>40</strong>-42</p>
  <p><strong>40</strong></p>
  <p>Desired values are highlighted with bold.</p>
  <p>Pretty much i just have to make sure that in the end i have two results which showcase each size - whatever is in front doesn't matter!</p>
  <p>Really hope someone can help me on the right path here - the sizes are always separated by - or / or &quot; - &quot; and &quot; / &quot;</p>