title: MSSQL Regex data filtring
body: <p>I'm trying to filter data from my table using regex pattern in SQL Management Studio 2008 R2.  </p>
  
  <p>My table "Asset" contain the column "Asset_n" which contains the asset names.
  The goal is to be able to filter five types of names only:</p>
  
  <ol>
  <li>contains only five numerical characters e.g <code>12345</code></li>
  <li>contains only six numerical characters e.g <code>123456</code></li>
  <li>contains five numerical characters and end with one or two no numerical e.g. <code>12345a</code> or <code>12345ab</code></li>
  <li>contains six numerical characters and end with one or two no numerical e.g.
  <code>123456a</code> or <code>123456ab</code></li>
  </ol>
  
  <p>Here is my query:</p>
  
  <pre><code>SELECT * FROM Asset WHERE asset_n LIKE [\d{5,6}\w{1,2}]
  </code></pre>
  
  <p>The query return nothing... I have used the same regex pattern in PowerShell and it's working perfectly.
  SQL is something new for me so I don't realy know how to build my regex pattern for SQL query's.</p>
  
  <p>Thanks in advance for your help.</p>