dev@jsr311.java.net

Re: JSR311: Proposal for regexs in path template vars

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Tue, 22 Jul 2008 23:42:16 +0200

Hi Marc,

sounds good to me.

best regards
  Stepan

Marc Hadley schrieb:
> After some experimentation I've convinced myself that allowing
> developers to specify regexs for their template parameters is
> workable. Here's what I propose we do:
>
> (a) Allow the developer to specify the content of the capturing group
> for a template parameter. E.g. {foo: .+} would result in a capturing
> group (.+) in the regex generated for the template. Whitespace around
> the parameter name and regex will be stripped.
> (b) If no regex is specified you get ([^/]+).
> (c) Implementations will not be required to encode literals in the
> regex (regardles of whether @Path.encode==true), developers have to do
> that themselves.
> (d) Remove the @Path.limited property since developers can use a regex
> to adjust the bounds of a capturing group.
> (e) The regex will be ignored by UriBuilder (no validation).
> (f) For the purposes of the matching algorithm, the regex resulting
> from a template will always have (/.*)? appended to the end (see
> existing 3.7.3 step 6).
>
> I attach some examples as a HTML table.