title: JAX-RS - @Path Param with Regular expression
body: <p>I am trying to implement a service using JSX-RS and I have a situation here where in multiple types of requests with varying version numbers should be catered to by a single method.</p>
  
  <pre><code>@Path("/url1/url2{version: [[/v][0-9][.][0-9]]*}")
  </code></pre>
  
  <p>this should cater to - </p>
  
  <pre>
  /url1/url2
  /url1/url2/v1
  /url1/url2/v1.2
  </pre>
  
  <p>where versions would be 0, 1 and 1.2 respectively.</p>
  
  <p>I have the correct regular expression but the code doesn't seem to accept it
  <code>((/v[0-9])(.[0-9])?)</code>? I am confused here.</p>
  
  <p>I need to restrict it to only one digit after v and after the decimal point(.) and I need only one occurance of /v*. For example -</p>
  
  <p><code>/ur1/url2/v1v1</code> not allowed</p>
  
  <p>Also I would like to know perfomrance wise, if I have a url with decimal points, is it going to cost me more time to parse it. Do I have to url encode it ? any other suggestions would is appreciated.</p>
  
  <p>The alternative approach is for every version, I have a seperate method with @path param. which is finally the best solution ?</p>
  
  <p>Any suggestion or ideas are greatly welcome !!!</p>