From 29778c7ea284e7118555c6a4a2e62daaeeccaebf Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Sun, 6 Nov 2022 04:54:35 +0100 Subject: [PATCH] Proper NVR matching --- pkg/rpmutils/regex.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/rpmutils/regex.go b/pkg/rpmutils/regex.go index cafd7d1..477d7f8 100644 --- a/pkg/rpmutils/regex.go +++ b/pkg/rpmutils/regex.go @@ -2,6 +2,5 @@ package rpmutils import "regexp" -var ( - Nvr = regexp.MustCompile("^(\\S+)-([\\w~%.+]+)-(\\w+(?:\\.[\\w+]+)+?)(?:\\.(\\w+))?(?:\\.rpm)?$") -) +// Nvr is a regular expression that matches a NVR. +var Nvr = regexp.MustCompile("^(\\S+)-([\\w~%.+]+)-(\\w+(?:\\.[\\w+]+)+?)(?:\\.rpm)?$")