>From 09ce2989c6091e4a2f6e0d20cff85518dbf94e93 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 23 Sep 2026 10:13:57 +0000 Subject: [PATCH 24/25] regex: support {,n} as {0,n} a non-standard extension that's easy to support. --- src/regex/regcomp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 5f6d5c28..a6ae7877 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -725,9 +725,11 @@ static const char *parse_dup(const char *s, int ere, int *pmin, int *pmax) int min, max; s = parse_dup_count(s, &min); - if (*s == ',') + if (*s == ',') { + if (min < 0) + min = 0; s = parse_dup_count(s+1, &max); - else + } else max = min; if ( -- 2.52.0