From: "ara.t.howard" Date: 2007-07-11T13:03:58+09:00 Subject: Re: Beautiful Code : Pity he didn't ask here... On Jul 10, 2007, at 8:08 PM, Marcel Molina Jr. wrote: > Looking at all those \d is kind of hard to parse also. I think the > following > way of expression that pattern is considerably clearer: > > %r|GET /ongoing/When/\d{3}x/(\d{4}/\d{2}/\d{2}/[^ .]+)|x > > Readability improves even more when Oniguruma allows for named > captures. yeah, i actually like to break them out like %r| GET \d\d\d\d # year \d\d # month | but i didn't want to go overboard! named captures are a real want in ruby right now if you ask me. i've been using the idiom match, yyyy, mm, dd, *ignored = pattern.match(string).to_a if match ... end as a workaround (for those that don't know the captures in patterns can be got that way) cheers. -a -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama