users@jsr311.java.net

Re: URI template with regexp using nested curly braces.

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 10 Mar 2009 13:55:22 -0400

On Mar 10, 2009, at 1:48 PM, Sergey Beryozkin wrote:
>
> I guess what I'm after here is for some sort of acknowledgement from
> other implementors that indeed the defaut Java regex support can not
> be relied upon when handling such expressions. The reason I ask is
> that the default Java support was assumed originally to be the
> technology for handling all the regex expressions JAXRS specs
> introduces. Checking the source code is not the goal - it would be
> nice to get some sort of exchange here
>
Let me play that back at you to see if I understand the question. You
are asking whether its possible to use Java regexs to pick apart the
value of an @Path annotation. You are not asking whether the regex
following the ':' character in a template parameter is a Java regex.
Right ?

Marc.

>>
>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>