title: What is the correct status code if request URL does not match regex
body: <p>I'm trying to develop error handling in my REST API and I'm currently working on the response codes. I haven't found a proper answer to what would be the appropriate response code for my problem.</p>
  
  <p>I have routes which are managed like this in the back-end code:</p>
  
  <pre><code>$site-&gt;route([
    'route' =&gt; '/{id:^[a-z]+$}'
  ]);
  </code></pre>
  
  <p>Now lets say the user inputs <code>www.example.com/page1</code> which does not match the <code>regex</code> pattern. What would be the correct response? I am thinking either a <code>404</code>, page not found, but I also think that a <code>400</code> response would be correct, because it describes that there was an error with the request.</p>
  
  <p>I already use 404 if static URLs are invalid, so this is a question of matching dynamic parts of the URLs.</p>
  
  <p>What are the field of use of both of these response codes in the case of REST APIs?</p>