From a123135b229a91351f3dcf94c9905036d7bb74c2 Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Tue, 23 Aug 2022 17:35:28 +0200 Subject: [PATCH] improve regex re 6e7e780faeed047324441e01235bbe066407ee14 --- xquery/date.xqm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xquery/date.xqm b/xquery/date.xqm index 124ffad..d26a6a1 100644 --- a/xquery/date.xqm +++ b/xquery/date.xqm @@ -118,7 +118,7 @@ declare function date:format-date($date as xs:date, $picture as xs:string, $lang declare function date:printDate($date as element()?, $lang as xs:string, $get-language-string as function(xs:string, xs:string*, xs:string) as xs:string, $get-picture-string as function(xs:string) as xs:string) as xs:string? { if($date) then ( let $picture-string := $get-picture-string($lang) (: if($lang = 'de') then '[D1o] [MNn] [Y]' else '[MNn] [D], [Y]':) - let $picture-string-day := replace($picture-string, '\[M[^\]]*\]|\[Y[^\]]*\]', '') (: strip off month and year specifier from the picture string :) + let $picture-string-day := replace($picture-string, '\[M[^\]]*\]|(,\s)?\[Y[^\]]*\]', '') => normalize-space() (: strip off month and year specifier from the picture string :) let $notBefore := if($date/@notBefore) then date:getCastableDate(data($date/@notBefore),false()) else if($date/@notBefore-iso) then date:getCastableDate(data($date/@notBefore-iso),false()) else()