Skip to content
Snippets Groups Projects
Commit 4156d360 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added a shortcut-regex to improve regex setup performance

parent 9ded4a79
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,9 @@ sub create_regex_last24h { ...@@ -89,6 +89,9 @@ sub create_regex_last24h {
sub create_regex_from_to { sub create_regex_from_to {
my $from=shift // "2000-01-01"; my $from=shift // "2000-01-01";
my $to=shift // "2059-12-31"; my $to=shift // "2059-12-31";
if ($from eq "2000-01-01" and $to eq "2059-12-31") {
return qr{20[0-5][0-9]-[01][0-9]-[0-3][0-9]};
}
my $dt_from = DateTime::Format::DateParse->parse_datetime("$from"); my $dt_from = DateTime::Format::DateParse->parse_datetime("$from");
my $dt_to = DateTime::Format::DateParse->parse_datetime("$to"); my $dt_to = DateTime::Format::DateParse->parse_datetime("$to");
my @date_tmo_s; my @date_tmo_s;
...@@ -138,4 +141,4 @@ sub execute { ...@@ -138,4 +141,4 @@ sub execute {
} }
} }
1; 1;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment