diff --git a/pkg/licensing/normalize.go b/pkg/licensing/normalize.go index 4ce294275214..bce81e68903d 100644 --- a/pkg/licensing/normalize.go +++ b/pkg/licensing/normalize.go @@ -626,7 +626,7 @@ func TrimLicenseText(text string) string { } // version number match -var versionRegexpString = "([A-UW-Z)]{2,})( LICENSE)?\\s*[,(-]?\\s*(V|V\\.|VER|VER\\.|VERSION|VERSION-|-)?\\s*([1-9](\\.\\d)*)[)]?" +var versionRegexpString = "([A-UW-Z)])( LICENSE)?\\s*[,(-]?\\s*(V|V\\.|VER|VER\\.|VERSION|VERSION-|-)?\\s*([1-9](\\.\\d)*)[)]?" // case insensitive version match anywhere in string var versionRegexp = regexp.MustCompile("(?i)" + versionRegexpString) diff --git a/pkg/licensing/normalize_test.go b/pkg/licensing/normalize_test.go index 9b47fd923f29..7daf7b57d783 100644 --- a/pkg/licensing/normalize_test.go +++ b/pkg/licensing/normalize_test.go @@ -209,6 +209,13 @@ func TestNormalize(t *testing.T) { normalized: " The unmapped license ", normalizedKey: " The unmapped license ", }, + { + licenses: []string{ + "Universal Permissive License, Version 1.0", + }, + normalized: "UPL-1.0", + normalizedKey: "UPL-1.0", + }, } for _, tt := range tests { t.Run(tt.normalized, func(t *testing.T) {