title: Match string using Spring @RequestMapping path expression
body: <p>Is there a way to match a string using the expression language used for the <code>path</code> (or <code>value</code>) variable in the <code>@RequestMapping</code> annotation? For example, given the string</p>
  
  <pre><code>/api/foo/bar/1
  </code></pre>
  
  <p>the expression </p>
  
  <pre><code>/api/foo/bar/{id}
  </code></pre>
  
  <p>should match this string (a test should be available that returns a boolean <code>true</code> if the expression matches the given string), and if possible, the captured portion of the string (namely, <code>{id}</code> capturing <code>1</code>) should also be available.</p>
  
  <p>Essentially, I am looking to use the same mechanism that Spring internally uses for <code>@RequestMapping</code> to check if a URL path (a combination of the context path and path information) matches in the expression language as <code>@RequestMapping</code>. I am doing this matching with a Spring security filter.</p>
  
  <p>Thank you for your help.</p>