Skip to content

Commit

Permalink
Merge pull request #274 from NASA-IMPACT/regex/sid
Browse files Browse the repository at this point in the history
Regex updated
  • Loading branch information
siddharth0248 authored Dec 20, 2024
2 parents da0650c + 2f39ead commit c22f94c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dags/veda_data_pipeline/utils/build_stac/utils/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c22f94c

Please sign in to comment.