title: Extract REGEXP Substring SQL Server
body: <p>I want to extract a specific number value from this query...</p>
  
  <p>Column: name
  Four rows for this example:</p>
  
  <ul>
  <li>1/2 Product1 some_description 1200 GR more data... (UND)</li>
  <li>1/4 Product2 some_description 2400G more data (KG more data)</li>
  <li>Product3 some_description 2200 GRS more data...</li>
  <li>1/4 Product4 some_description 1800GR more data UND...</li>
  </ul>
  
  <p>I want the integer value only. I want with the query:</p>
  
  <ul>
  <li>1200</li>
  <li>2400</li>
  <li>2200</li>
  <li>1800</li>
  </ul>
  
  <p>The patterns are: </p>
  
  <ul>
  <li>[0-9]{4} G</li>
  <li>[0-9]{4}GR</li>
  <li>[0-9]{4} GRS</li>
  </ul>
  
  <p>How can i use this regexp on a SQL Query to parse an attribute value?</p>
  
  <p><code>
  SELECT FROM myTable 
  SUBSTRING(name, (PATINDEX('%[0-9]%', [name])),4) as peso
  </code></p>
  
  <p>This extract some values, but not in correct order... I think that i can apply LEFT with length until integer value, but i don't know how resolve it.</p>