title: Regular expression exact number and only positive
body: <p>I have a little problem to obtain a regular expresion which satisfy the fact that match the exact number base on a list and the number is positive, at the beginning I was working with the following:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;script type="text/javascript"&gt;
      var patt1=/\b(100|101)/g;
  
      var str="-101";
      document.write(str.match(patt1));
      document.write("&lt;br/&gt;");
      var str="101";
      document.write(str.match(patt1));
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But I realized that in this case it will return 101 and -101 as valid. Then I tried </p>
  
  <pre><code>var var patt1=/[^-]\b(100|101)/g;
  </code></pre>
  
  <p>but the result was <code>null</code> for both cases, then </p>
  
  <pre><code>var patt1=/(^-)\b(100|101)/g; 
  </code></pre>
  
  <p>but the result instead of being <code>null</code> and then <code>101</code> was the opposite <code>-101 null</code>.<br>
  I want the 101 and not the -101 any idea about how to do this.</p>