abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Gendron" <r...@arrova.ca>
Subject Route matching for categories
Date Thu, 01 May 2008 14:31:06 GMT
Hello all,

 

My Regex is not good enough to interpret the intricacies of the Route class
internals.

 

I have chosen the GDATA URI pattern (…/-/cat1/cat2/cat3/etc) to target
categories.

 

It works great for targeting one category, but fails with multiple
categories. The second unit test below fails:

 

    @Test

    public void testRouteSingleCategory() {

        Route r = new Route("test", "/atom/:collection/-/:categories");

        

        assertTrue(r.match("/atom/movies/-/scifi"));

    }

 

    @Test

    public void testRouteMultipleCategories() {

        Route r = new Route("test", "/atom/:collection/-/:categories");

        

        assertTrue(r.match("/atom/movies/-/scifi/drama"));

    }

 

Can a regex guru explain in plain english the match pattern used in the
Route class?

 

Thanks,

 

Rémy

 



 

Courriel:            remy.gendron@arrova.ca

Cellulaire:          418 809-8585

Site Web:           <http://arrova.ca/> http://arrova.ca

Liste:
<http://mail.arrova.ca/mailman/listinfo/dev-list_arrova.ca>
http://mail.arrova.ca/mailman/listinfo/dev-list_arrova.ca

 


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message