title: Regex to match string that does not contain slash
body: <p>I am trying to set up a route using <a href="https://next.router.vuejs.org/" rel="nofollow noreferrer"><code>vue-router</code></a> in a web app using regex to match the pattern. The pattern I am looking to match is any string that contains alphanumeric characters (and underscore) without slashes. Here are some examples (the first slash is just to show the string after the domain e.g. example.com/):</p>
  <pre><code>/codestack
  /demo45
  /i_am_long
  </code></pre>
  <p>Strings that should <strong>not</strong> match would be:</p>
  <pre><code>/data/files.xml
  /share/home.html
  /demo45/photos
  </code></pre>
  <p>The only regex I came up with so far is:</p>
  <pre><code>path: '/:Username([a-zA-Z0-9]+)'
  </code></pre>
  <p>That is not quite right because it matches all the characters except for the slash. Whereas I want to only match on the first set of alphanumeric characters (including underscore) before the first forward slash is encountered.</p>
  <p>If a route contains a forward slash e.g. <code>/data/files.xml</code> then that should be a different regex route match. Therefore I <em>also</em> need a regex pattern to match the examples above containing slashes. Theoretically, they could contain any number of slashes e.g. <code>/demo45/photos/holiday/2015/bahamas</code>.</p>