NAME
DateTime::Format::Builder::Parser::Regex - Regex based date parsing
SYNOPSIS
my $parser = DateTime::Format::Builder->create_parser(
regex => qr/^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)$/,
params => [ qw( year month day hour minute second ) ],
);
SPECIFICATION
In addition to the common keys, Regex
supports:
regex is a regular expression that should capture elements of the datetime string. This is a required element. This is the key whose presence indicates it's a specification that belongs to this class.
params is an arrayref of key names. The captures from the regex are mapped to these (
$1
to the first element,$2
to the second, and so on) and handed toDateTime->new()
. This is a required element.extra is a hashref of extra arguments you wish to give to
DateTime->new()
. For example, you could set theyear
ortime_zone
to defaults:extra => { year => 2004, time_zone => "Australia/Sydney" },
THANKS
See the main module's section.
SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.
Alternatively, log them via the CPAN RT system via the web or email:
http://perl.dellah.org/rt/dtbuilder
bug-datetime-format-builder@rt.cpan.org
This makes it much easier for me to track things and thus means your problem is less likely to be neglected.
LICENSE AND COPYRIGHT
Copyright © Iain Truskett, 2003. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the licenses can be found in the Artistic and COPYING files included with this module.
AUTHOR
Iain Truskett <spoon@cpan.org>
SEE ALSO
datetime@perl.org
mailing list.
http://datetime.perl.org/