Subject: | ${RE}{time}{iso} does not match factions of second |
Date: | Tue, 22 Sep 2015 14:10:35 +0200 |
To: | bug-Regexp-Common-time [...] rt.cpan.org |
From: | Daniel Dehennin <daniel.dehennin [...] baby-gnu.org> |
Hello,
I'm trying to parse RFC3339 Date/Time strings but it does not take the
factions of second[1][2] part.
The following oneliner:
perl -MRegexp::Common=time -E 'say $1 if "2015-09-19T00:15:20.373610+02:00" =~ /^($RE{time}{iso})/'
outputs:
2015-09-19T00:15:20
but should output
2015-09-19T00:15:20.373610+02:00
I work around it by matching any non space characters after
“$RE{time}{iso}”:
perl -MRegexp::Common=time -E 'say $1 if "2015-09-19T00:15:20.373610+02:00" =~ /^($RE{time}{iso}\S+)/'
outputs:
2015-09-19T00:15:20.373610+02:00
Regards.
Perl version: This is perl 5, version 20, subversion 2 (v5.20.2) built
for x86_64-linux-gnu-thread-multi (with 51 registered
patches, see perl -V for more detail)
Regexp:Common::time version: 0.05 (Ubuntu Trusty)
Regexp:Common::time version: 0.07 (Debian Sid)
Footnotes:
[1] https://www.cl.cam.ac.uk/~mgk25/iso-time.html#time
[2] https://tools.ietf.org/html/rfc3339#section-5.6
--
Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF
Message body not shown because it is not plain text.