From 2f39ead56c32cca392993b5e58985775ec4393ae Mon Sep 17 00:00:00 2001 From: siddharth0248 Date: Fri, 20 Dec 2024 10:25:13 -0600 Subject: [PATCH] regex updated --- .../utils/build_stac/utils/regex.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dags/veda_data_pipeline/utils/build_stac/utils/regex.py b/dags/veda_data_pipeline/utils/build_stac/utils/regex.py index 471832ee..6493e73d 100644 --- a/dags/veda_data_pipeline/utils/build_stac/utils/regex.py +++ b/dags/veda_data_pipeline/utils/build_stac/utils/regex.py @@ -41,13 +41,13 @@ def extract_dates( Extracts start & end or single date string from filename. """ DATE_REGEX_STRATEGIES = [ - (r"_(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})", "%Y-%m-%dT%H:%M:%S"), - (r"_(\d{8}T\d{6})", "%Y%m%dT%H%M%S"), - (r"_(\d{4}_\d{2}_\d{2})", "%Y_%m_%d"), - (r"_(\d{4}-\d{2}-\d{2})", "%Y-%m-%d"), - (r"_(\d{8})", "%Y%m%d"), - (r"_(\d{6})", "%Y%m"), - (r"_(\d{4})", "%Y"), + (r"[_\.\-](\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})", "%Y-%m-%dT%H:%M:%S"), + (r"[_\.\-](\d{8}T\d{6})", "%Y%m%dT%H%M%S"), + (r"[_\.\-](\d{4}_\d{2}_\d{2})", "%Y_%m_%d"), + (r"[_\.\-](\d{4}-\d{2}-\d{2})", "%Y-%m-%d"), + (r"[_\.\-](\d{8})", "%Y%m%d"), + (r"[_\.\-](\d{6})", "%Y%m"), + (r"[_\.\-](\d{4})", "%Y"), ] # Find dates in filename