manwar / regexp-common-time Goto Github PK
View Code? Open in Web Editor NEWRepository of the Regexp-Common-time Perl distributions
Home Page: https://metacpan.org/release/Regexp-Common-time
Repository of the Regexp-Common-time Perl distributions
Home Page: https://metacpan.org/release/Regexp-Common-time
Regexp::Common::time v0.09 ========================== This is a Regexp::Common plugin that provides regular expressions for parsing dates and times. It can handle most date formats, such as: y/m/d m/d/y d/m/y 2005/04/02 4/2/2005 2/4/05 05.04.02 04.02.05 02.04.2005 2005 April 2 April 2, 2005 2 APR 05 05APRIL02 APR022005 02 April 2005 20050402 040205 02042005 ISO 8601 RFC 2822 2008-05-24T21:46:01 25 May 2008 21:46:01 +0500 It can also handle time formats like: 9:03:27pm 21:03:27 9:03 p.m. 21:03 9:03a Furthermore, you can easily piece together time and date component patterns (in the style of Time::Format or POSIX's strftime) to build arbitrarily complex custom regexes that can parse just about any time or date pattern imaginable. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install On Windows, you will need to use nmake instead of make. DEPENDENCIES This module requires this other modules and libraries: Regexp::Common POSIX (optional) I18N::Langinfo (optional, but needed for internationalization) Also, Time::Normalize is likely to be useful to you. COPYRIGHT AND LICENSE Eric J. Roode, roode @ cpan . org Copyright (c) 2005-2008 by Eric J. Roode. All Rights Reserved. This module is free software; See the copyright notice in the module source code for full details. To avoid my spam filter, please include "Perl", "module", or this module's name in the message's subject line, and/or GPG-sign your message.
t/american.t depends on the 'unicode_strings' feature, which is a 5.12+ feature, but META for this module indicates support for perls 5.6 and up.
$ prove -v t/american.t
t/american.t .. Feature "unicode_strings" is not supported by Perl 5.10.1 at t/american.t line 4.
BEGIN failed--compilation aborted at t/american.t line 4.
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Test Summary Report
-------------------
t/american.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU)
Result: FAIL
this would additionally fail on perls without feature in core (perls before 5.9.3)
Hi Mohammed,
The ISO spec states that either both the date and time must have a separator, or neither may have it.
However this module matches a non-conformant date:
$ perl -MRegexp::Common=time -wE 'say $RE{time}{iso}->matches("1901-02-03T040506")'
1
On the other hand DateTime::Format::ISO8601
rejects the date:
$ perl -MDateTime::Format::ISO8601 -wE 'say DateTime::Format::ISO8601->parse_datetime("1901-02-03T040506")->datetime;'
Invalid date format: 1901-02-03T040506 at -e line 1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.