Re: Beautiful Code : Pity he didn't ask here...
- From: "Marcel Molina Jr." <marcel@xxxxxxxxxx>
- Date: Wed, 11 Jul 2007 11:08:26 +0900
On Wed, Jul 11, 2007 at 10:53:42AM +0900, ara.t.howard wrote:
%r|GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/[^ .]+)|x
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.
marcel
--
Marcel Molina Jr. <marcel@xxxxxxxxxx>
.
- Follow-Ups:
- Re: Beautiful Code : Pity he didn't ask here...
- From: John Joyce
- Re: Beautiful Code : Pity he didn't ask here...
- From: ara.t.howard
- Re: Beautiful Code : Pity he didn't ask here...
- References:
- Re: Beautiful Code : Pity he didn't ask here...
- From: Tim Bray
- Re: Beautiful Code : Pity he didn't ask here...
- From: ara.t.howard
- Re: Beautiful Code : Pity he didn't ask here...
- Prev by Date: Re: Beautiful Code : Pity he didn't ask here...
- Next by Date: Re: Beautiful Code : Pity he didn't ask here...
- Previous by thread: Re: Beautiful Code : Pity he didn't ask here...
- Next by thread: Re: Beautiful Code : Pity he didn't ask here...
- Index(es):
Relevant Pages
|