diff --git a/vars/findVersionFromNexusRepo.groovy b/vars/findVersionFromNexusRepo.groovy index b81f2b6..d7a06b7 100644 --- a/vars/findVersionFromNexusRepo.groovy +++ b/vars/findVersionFromNexusRepo.groovy @@ -45,7 +45,7 @@ Map call(Map config = [:], Map queryParams = [:]) { /* groovylint-disable-next-line Instanceof */ if (latest.version instanceof net.sf.json.JSONNull && latest.name) { echo 'Info: Search result version field was null, looking in name field for a version' - java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.].*)/) + java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/) if (!match) { echo "Error: Match: ${match}" error("Regular expression match failed for latest.name: ${latest.name}")