We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31e377a commit 7e74bb1Copy full SHA for 7e74bb1
1 file changed
src/NuGet.Core/NuGet.Packaging/Licenses/LicenseExpressionTokenizer.cs
@@ -10,6 +10,7 @@ namespace NuGet.Packaging.Licenses
10
{
11
internal class LicenseExpressionTokenizer
12
13
+ private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
14
private readonly string _value;
15
16
/// <summary>
@@ -34,8 +35,7 @@ internal LicenseExpressionTokenizer(string value)
34
35
/// <returns>Whether the value has valid characters.</returns>
36
internal bool HasValidCharacters()
37
- var regex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
38
- return regex.IsMatch(_value);
+ return ValidCharactersRegex.IsMatch(_value);
39
}
40
41
0 commit comments