users@jsr311.java.net

Re: URI template with regexp using nested curly braces.

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Tue, 10 Mar 2009 17:17:26 -0000

Hi


> Hi everybody,
> Specification says that URI template can specify regexp it matches. It
> does not state what kind of regexp can be used, I assume Java regexp
> as default. In that case it is possible to use nested curly braces
> e.g. "/area/{zipcode:[0-9]{5}}" to match "/area/90210".
>
> What I am looking for is regular expression that catches template
> variables. Problem is in Java regexp nested expression are hard (or
> impossible) to express -- perl regexp syntax has additional
> constructions that allow to catch nested closing brackets, Java's way
> is not to get out from regexp grammar towards context-free grammars
> that would allow to match such recursion problem.
> Any ideas?

Can someone confirm please that as far as handling expressions like "/area/{zipcode:[0-9]{5}}", it's up to
a given implementation how to handle them and no assumption can be made that the default Java regexp should be used ?

Thanks, Sergey

>
> I also wonder how jersey implementation takes care of nested curly braces.
>
> cheers,
> andy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>