From 82773aab3b6f3fd144108ddb965eec777163abb5 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Thu, 20 Jun 2024 18:39:26 +0200 Subject: [PATCH] fix date regex --- internal/booking/service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/booking/service.go b/internal/booking/service.go index d6bba68..17fc4c4 100644 --- a/internal/booking/service.go +++ b/internal/booking/service.go @@ -3,6 +3,7 @@ package booking import ( "encoding/json" "fmt" + "log" "regexp" "strconv" "strings" @@ -258,11 +259,11 @@ func (bs Service) ParseFromApi(rawContent string) (*Booking, error) { } func extractDate(pattern, content string) string { - re := regexp.MustCompile(pattern + `\w+\.\s*\d{1,2}\s\w+\.\s\d{4}`) + re := regexp.MustCompile(pattern + `\w+\.\s*\d{1,2}\s\w+\.*\s\d{4}`) dateMatch := re.FindString(content) if dateMatch == "" { - fmt.Println("date not found") + log.Println("date not found") return "" }