title: How to get JavaScript regular expression without the querying part?
body: <p>For example, if I have urls like <code>url = ['aaa.com/subject/12345', 'aaa.com/book/45678']</code>. I want to get <code>"subject"</code> and <code>"ebook"</code> and the number out of it.</p>
  
  <p>If I use <code>url[i].match(/\/(\w)*\//)</code>, it will return <code>["/subject/", "t"]</code> and <code>["/book/", "k"]</code> for <code>i</code> equals <code>0</code> and <code>1</code>.</p>
  
  <p>Of course, I can use <code>slice(1, -1)</code> to get <code>"subject"</code> and <code>"book"</code>. </p>
  
  <p>But <strong>is it possible to use regular expression only to get <code>"subject"</code> instead of <code>"/subject/"</code>?</strong></p>