title: Use Regex in Vue Router Paths
body: <p>I am creating a VueJS app which heavily uses the vue router.</p>
  
  <p>Here's the structure of my <code>routes.js</code>:</p>
  
  <pre><code>export const routes = [
      { path: '', component: Poetry, children: [
          { path: '', name: 'poetry', component: PoetryLanding },
          { path: 'poetry/:id', name: 'poetrycard', component: PoetryCard },
          { path: 'poetry/search', name: 'poetrysearch', component: PoetrySearch },
      ]},
  ]
  </code></pre>
  
  <p>I want to use regex in second child component i.e. <code>poetrycard</code> such that it only accepts the params(<code>:id</code>) which is a number. I am doing this because <code>poetrysearch</code> gets affected as <code>/search</code> is treated as <code>:id</code>!</p>
  
  <p>I tried:</p>
  
  <pre><code>{ path: 'poetry/:id/[0-9]/g', name: 'poetrycard', component: PoetryCard }
  </code></pre>
  
  <p>But this doesn't work. Please help.</p>