title: Regex match but exclude
body: <p>I am having some trouble with <em>regex</em> in <strong>JavaScript</strong>. I need to test whether a URL matches this simple pattern, invoking the <code>RegExp.prototype.test(value: string): boolean</code> method.</p>
  
  <p>I want the result to be <code>true</code> for URLs like this:</p>
  
  <pre><code>/somePath
  /anyPath
  /doesNotMatterWhatIsHere
  </code></pre>
  
  <p>And I'd like it to return <code>false</code> for any path that is like this:</p>
  
  <pre><code>/
  /somePath/someWhereElse
  /anyPath/1
  /doesNotMatterWhatIsHere/pickle/chips/are/awesome
  </code></pre>
  
  <p>The point being, if it is the root <code>/path</code> I want <code>true</code> and if it is anything other than this, I want <code>false</code>. Please help.</p>
  
  <p>I have been using <a href="http://regexr.com/" rel="nofollow noreferrer">http://regexr.com/</a>.</p>
  
  <p>My Regex I have thus far, <code>\/.+[^\/]</code>.</p>