Subject: Re: [PATCH (BUGFIX)] gitweb: Fix handling of fractional timezones in parse_date

From: Jakub Narebski <[email-masked]>
Date: Fri, 25 Mar 2011 18:47:38 +0100

Junio C Hamano wrote:
> Kevin Cernekee <[email-masked]> writes:
> 
> > It's just a matter of personal preference, but I would find this
> > regexp slightly easier to read:
> >
> > +               ($tz =~ m/^([+\-])([0-9]{2})([0-9]{2})$/);
> 
> I'd say "^([-+])(\d\d)(\d\d)$" makes it the most clear.

But what does 'digit character' mean?  Is "\d" Unicode-aware, because
if it is it might match other digits than 0-9?

#perl says:

<rindolf> ShadeHawk: hi.
<rindolf> ShadeHawk: \d matches Unicode digits in unicode contexts I think.
<rindolf> ShadeHawk: like the ones used for Written Arabic.
<rindolf> ShadeHawk: let's see.
<rindolf> perlbot: eval: ["٣" =~ /\d/ ? "Match" : "Nomatch"]
<perlbot> rindolf: ["Match"]
<rindolf> Yay!
<rindolf> That's three in http://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system

Anyway gitweb uses \d in various regexps, so it shouldn't be worse
than it is now.  

[...]

> Care to re-roll the patch?

Will do. 

-- 
Jakub Narebski
ShadeHawk on #git and #perl
Poland