Skip to content

Commit

Permalink
fix regex to account for 2 digit or 1 digit named .nupkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Nov 20, 2024
1 parent 99a8588 commit 197b6df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/code/LocalServerApiCalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private FindResults FindNameHelper(string packageName, string[] tags, bool inclu
string actualPkgName = packageName;

// this regex pattern matches packageName followed by a version (4 digit or 3 with prerelease word)
string regexPattern = $"{packageName}" + @"\.\d+\.\d+\.\d+(?:[a-zA-Z0-9-.]+|.\d)?.nupkg";
string regexPattern = $"{packageName}" + @"(\.\d+){1,3}(?:[a-zA-Z0-9-.]+|.\d)?\.nupkg";
Regex rx = new Regex(regexPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
_cmdletPassedIn.WriteDebug($"package file name pattern to be searched for is: {regexPattern}");

Expand Down

0 comments on commit 197b6df

Please sign in to comment.