title: Validate range for fetching records
body: <p>I am working on a regular expression  which requires the following pattern <strong>with and without spaces</strong></p>
  
  <ul>
  <li>Comma separated list of alphanumeric values : DG1, D3 OR R4,UI2</li>
  <li>Comma separated list of alphanumeric and numeric values : D1, 2 OR D1,2</li>
  <li>Range of alphanumeric values : DG1 - DG5 OR DG1-DG5</li>
  <li>Range of alphanumeric and numeric values : DG1 - 8 OR DG1-8 OR 8-DG11 OR 8 - DG13</li>
  <li>A combination of range and comma separated values : DG1, DG3-DG7 OR DG1,DG3-DG6</li>
  <li>A combination of range and comma separated alphanumeric and numeric values : DG1, 3-DG7 OR 1,DG3-6</li>
  <li>No other special character should be allowed other than comma and hyphen</li>
  <li>2 special characters cannot come together</li>
  <li>Cannot start or end with a special character</li>
  </ul>
  
  <p>Invalid values may be </p>
  
  <ul>
  <li>,1,DG1</li>
  <li>-DG1-5</li>
  <li>DG1 - 3 - GP9</li>
  <li>1,F4,</li>
  <li>RE3-</li>
  <li>1,-G3</li>
  <li>5,S3,-9</li>
  </ul>