From 24cbe33b7918697695bb266f909d596efb78e03f Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 11 Nov 2025 18:52:47 +0100 Subject: [PATCH] change regex extended --- src/time_format.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/time_format.c b/src/time_format.c index e79911d..c49f3d6 100644 --- a/src/time_format.c +++ b/src/time_format.c @@ -10,7 +10,7 @@ #define SHORT_WEEKDAY_STR_LEN 3 #define MAX_TIME_STR_LENGTH 7 -#define DATE_REGEX "[0-9]\\{4\\}-\\([0][1-9]\\|1[0-2]\\)-\\([0-2][1-9]\\|[1-3]0\\|3[01]\\)" +#define DATE_REGEX "[0-9]{4}-([0][1-9]|1[0-2])-([0-2][1-9]|[1-3]0|3[01])" void get_time_str(time_t timediff, char* timestr) { @@ -193,7 +193,7 @@ bool validate_datestring(const char* date) if (date_regex == NULL) return false; - int comp_success = regcomp(date_regex, DATE_REGEX, REG_NOSUB); + int comp_success = regcomp(date_regex, DATE_REGEX, REG_NOSUB | REG_EXTENDED); if (comp_success != 0) { free(date_regex); return false; -- 2.47.3