title: Match URI with current URL
body: <p>I made a simple router system and I'm trying to match the current uri with an url, check:</p>
  
  <pre><code>$listUri = "transaction/.+";
  $uri = isset($_REQUEST['uri']) ? $_REQUEST['uri'] : '/'; // transaction/19-02-2016
  
  if(preg_match("#^$listUri$#", $uri)) 
  {
      echo "done!";
  }
  </code></pre>
  
  <p>now I see correctly the <code>echo "done!";</code> but suppose that I put that I've this situation:</p>
  
  <pre><code>$listUri = "transaction/.+";
  $uri = isset($_REQUEST['uri']) ? $_REQUEST['uri'] : '/'; // transaction/19-02-2016/SomeWrongUrlRequest?
  
  if(preg_match("#^$listUri$#", $uri)) 
  {
      echo "done!";
  }
  </code></pre>
  
  <p>the <code>echo "done!"</code> is also printed... and this is bad. I've mapped the url like so: <code>"/transaction/.+";</code> where <code>.+</code> is the parameter <code>19-02-2016</code> after it, if there is more content after the <code>.+</code> the request must be incorrect.</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>In other word:</p>
  
  <pre><code>$uri     =&gt;  "transaction/19-02-2016/SomeWrongUrlRequest"
  $listUri =&gt;  "transaction/.+"
  </code></pre>
  
  <p>if <code>$listUri</code> have <code>transaction/.+</code> I must have this: </p>
  
  <pre><code>`transaction/19-02-2016/` (correct with or without final slash)
  
  `transaction/19-02-2016/SomeWrongUrlRequest` (incorrect - there is only a .+ it would have been correct if $listUri had been: transaction/.+/SomeWrongUrlRequest)
  </code></pre>
  
  <p>so I have to make the match with the contents equal to the current URI</p>