title: Regex for internal URL
body: <p>I'm trying to create a regex that matches with internal URLs (the ones that don't include the domain or http) that I can find in a file like this one:</p>
  
  <blockquote>
    <p>category/subcategory/sub-subcategory/item-1</p>
  </blockquote>
  
  <p>For that I'm using: </p>
  
  <pre><code>/\w+\/.+\/[\w\-]+/
  </code></pre>
  
  <p>But some URLs are like this:</p>
  
  <blockquote>
    <p>category/subcategory</p>
  </blockquote>
  
  <p>And I need a regular expression that also catch those. Do I have to create a different one or is it possible to create one that match both examples? Is for a BASH script but if you have an idea it does not matter if it is for other engine. </p>
  
  <p>Thank you!!</p>
  
  <p>Update: I forgot the context. Each line of the file is like this:</p>
  
  <blockquote>
    <p>"11","category/subcategory/sub-subcategory/item-1","index.php?option=com_trombinoscopeextended&amp;Itemid=125&amp;lang=es&amp;view=trombinoscope","251","0","0000-00-00","","","","","","","0"</p>
  </blockquote>
  
  <p>Or like this:</p>
  
  <blockquote>
    <p>"4","category/subcategory","index.php?option=com_trombinoscopeextended&amp;Itemid=121&amp;lang=es","0","1","0000-00-00","","","","","","","0"</p>
  </blockquote>
  
  <p>I need to extract the examples for each line. </p>
  
  <p>Thanks. </p>