From d45966e1fd86057e82e352a4faac199f03824bea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?No=C3=A9mie=20Lehuby?= <noemie@junglebus.io>
Date: Fri, 18 Feb 2022 15:17:02 +0100
Subject: [PATCH] improve validation of interval tag

---
 resources/data/validator/numeric.mapcss | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/resources/data/validator/numeric.mapcss b/resources/data/validator/numeric.mapcss
index 821df43cd..07f60f203 100644
--- a/resources/data/validator/numeric.mapcss
+++ b/resources/data/validator/numeric.mapcss
@@ -530,16 +530,18 @@ node[fire_hydrant:pressure="#"] {
   throwError: tr("unusual value of {0}", "{0.key}");
 }
 
-*[interval][interval !~ /^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] {
+*[interval][interval !~ /^([0-9][0-9]?[0-9]?|[0-9]+[0-9]:[0-5][0-9](:[0-5][0-9])?)$/] {
   throwWarning: tr("unusual value of {0}", "{0.key}");
   assertNoMatch: "way interval=5";
   assertNoMatch: "way interval=20";
   assertNoMatch: "way interval=00:05";
   assertNoMatch: "way interval=00:05:00";
   assertNoMatch: "way interval=03:00:00";
-  assertMatch: "way interval=123";
+  assertNoMatch: "relation interval=168:00:00";
+  assertNoMatch: "relation interval=120";
   assertMatch: "way interval=0:5:0";
   assertMatch: "way interval=00:65:00";
+  assertMatch: "way interval=00:15:90";
 }
 
 /* #15107 */
@@ -669,4 +671,4 @@ node[fire_hydrant:pressure="#"] {
   assertMatch: "node name=12";
   assertMatch: "node name=3.5";
   assertNoMatch: "node name=\"1. Chemnitzer Billardclub 1952 e.V.\"";
-}
\ No newline at end of file
+}
-- 
2.25.1

