users@jsr311.java.net

Re: Few question about custom regular expressions

From: Sergey Beryozkin <sergey.beryozkin_at_progress.com>
Date: Wed, 3 Dec 2008 13:57:19 -0000

>
>> Hi,
>>>
>>
>> So how can I find out if the user meant to say with @Path("a.b")
>>
>> "path should start from a, followed by any single word character,
>> and finished with b". Well, possibky using
>> @Path("a\\wb") would be better but @Path("a.b") also works.
>>
> To do that the user would have to put in a dummy variable like this:
>
> @Path("a{something:.}b"). You can only use regex stuff inside a
> variable, not in the literal part of a path template.
>
<snip/>
>
>> Am I still missing the point ?
>>
> That I can't say ;-). What about the above isn't clear ?

I was missing it :-).

I need to have this test passing now :

URITemplate uriTemplate = new URITemplate("/books/a.b");
assertTrue(uriTemplate.match("/books/a.b"));
assertFail(uriTemplate.match("/books/abc"));

Thanks, Sergey

>
> Marc.
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>