Re: [PATCH (BUGFIX)] gitweb: Fix handling of fractional timezones in parse_date
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Mar 25, 2011, 17:47 UTC
- Message-ID
- <201103251847.39881.jnareb@gmail.com>
- In-Reply-To
- <7v8vw36s0r.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 8 quoted lines
> Kevin Cernekee <cernekee@gmail.com> 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