{
    "mode": "perldoc",
    "parameter": "DateTime::Format::Builder::Parser::Regex",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/DateTime%3A%3AFormat%3A%3ABuilder%3A%3AParser%3A%3ARegex/json",
    "generated": "2026-07-05T09:32:52Z",
    "synopsis": "my $parser = DateTime::Format::Builder->createparser(\nregex  => qr/^(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)T(\\d\\d)(\\d\\d)(\\d\\d)$/,\nparams => [qw( year month day hour minute second )],\n);",
    "sections": {
        "NAME": {
            "content": "DateTime::Format::Builder::Parser::Regex - Regex based date parsing\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 0.83\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $parser = DateTime::Format::Builder->createparser(\nregex  => qr/^(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)T(\\d\\d)(\\d\\d)(\\d\\d)$/,\nparams => [qw( year month day hour minute second )],\n);\n",
            "subsections": []
        },
        "SPECIFICATION": {
            "content": "In addition to the common keys, \"Regex\" supports:\n\n*   regex\n\nregex is a regular expression that should capture elements of the datetime string. This is a\nrequired element. This is the key whose presence indicates it's a specification that belongs\nto this class.\n\n*   params\n\nparams is an arrayref of key names. The captures from the regex are mapped to these ($1 to\nthe first element, $2 to the second, and so on) and handed to \"DateTime->new\". This is a\nrequired element.\n\n*   extra\n\nextra is a hashref of extra arguments you wish to give to \"DateTime->new\". For example, you\ncould set the \"year\" or \"timezone\" to defaults:\n\nextra => { year => 2004, timezone => \"Australia/Sydney\" },\n\n*   constructor is either an arrayref or a coderef. If an arrayref then the first element is a\nclass name or object, and the second element is a method name (or coderef since Perl allows\nthat sort of thing). The arguments to the call are anything in $p and anything given in the\n\"extra\" option above.\n\nIf only a coderef is supplied, then it is called with arguments of $self, $p and \"extra\".\n\nIn short:\n\n$self->$coderef( %{$p}, %{ $self->{extra} } );\n\nThe method is expected to return a valid DateTime object, or \"undef\" in event of failure,\nbut can conceivably return anything it likes. So long as it's 'true'.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "\"datetime@perl.org\" mailing list.\n\nhttp://datetime.perl.org/\n\nperl, DateTime, DateTime::Format::Builder\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted at <https://github.com/houseabsolute/DateTime-Format-Builder/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for DateTime-Format-Builder can be found at\n<https://github.com/houseabsolute/DateTime-Format-Builder>.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Dave Rolsky <autarch@urth.org>\n\n*   Iain Truskett <spoon@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is Copyright (c) 2020 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
            "subsections": []
        }
    },
    "summary": "DateTime::Format::Builder::Parser::Regex - Regex based date parsing",
    "flags": [],
    "examples": [],
    "see_also": []
}