@@ -29,6 +29,7 @@ public static Regex GetOrAdd([StringSyntax(StringSyntaxAttribute.Regex)] string
2929 [ Common . SwitchArgumentRegexPattern ] = Common . SwitchArgumentRegex ,
3030 [ Common . ObscurePasswordRegexPattern ] = Common . ObscurePasswordRegex ,
3131 [ Common . ExpandTokensRegexPattern ] = Common . ExpandTokensRegex ,
32+ [ Common . SanitizeNameRegexPattern ] = Common . SanitizeNameRegex ,
3233 [ Configuration . DefaultTagPrefixRegexPattern ] = Configuration . DefaultTagPrefixRegex ,
3334 [ Configuration . DefaultVersionInBranchRegexPattern ] = Configuration . DefaultVersionInBranchRegex ,
3435 [ Configuration . MainBranchRegexPattern ] = Configuration . MainBranchRegex ,
@@ -50,6 +51,7 @@ public static Regex GetOrAdd([StringSyntax(StringSyntaxAttribute.Regex)] string
5051 [ Output . AssemblyVersionRegexPattern ] = Output . AssemblyVersionRegex ,
5152 [ Output . AssemblyInfoVersionRegexPattern ] = Output . AssemblyInfoVersionRegex ,
5253 [ Output . AssemblyFileVersionRegexPattern ] = Output . AssemblyFileVersionRegex ,
54+ [ Output . SanitizeAssemblyInfoRegexPattern ] = Output . SanitizeAssemblyInfoRegex ,
5355 [ Output . CsharpAssemblyAttributeRegexPattern ] = Output . CsharpAssemblyAttributeRegex ,
5456 [ Output . FsharpAssemblyAttributeRegexPattern ] = Output . FsharpAssemblyAttributeRegex ,
5557 [ Output . VisualBasicAssemblyAttributeRegexPattern ] = Output . VisualBasicAssemblyAttributeRegex ,
@@ -84,6 +86,9 @@ internal static partial class Common
8486 [ StringSyntax ( StringSyntaxAttribute . Regex ) ]
8587 internal const string ExpandTokensRegexPattern = """{((env:(?<envvar>\w+))|(?<member>\w+))(\s+(\?\?)??\s+((?<fallback>\w+)|"(?<fallback>.*)"))??}""" ;
8688
89+ [ StringSyntax ( StringSyntaxAttribute . Regex , Options ) ]
90+ internal const string SanitizeNameRegexPattern = "[^a-zA-Z0-9-]" ;
91+
8792 [ GeneratedRegex ( SwitchArgumentRegexPattern , Options ) ]
8893 public static partial Regex SwitchArgumentRegex ( ) ;
8994
@@ -92,6 +97,9 @@ internal static partial class Common
9297
9398 [ GeneratedRegex ( ExpandTokensRegexPattern , Options ) ]
9499 public static partial Regex ExpandTokensRegex ( ) ;
100+
101+ [ GeneratedRegex ( SanitizeNameRegexPattern , Options ) ]
102+ public static partial Regex SanitizeNameRegex ( ) ;
95103 }
96104
97105 internal static partial class Configuration
@@ -231,6 +239,9 @@ internal static partial class Output
231239 [ StringSyntax ( StringSyntaxAttribute . Regex ) ]
232240 internal const string SanitizeParticipantRegexPattern = "[^a-zA-Z0-9]" ;
233241
242+ [ StringSyntax ( StringSyntaxAttribute . Regex ) ]
243+ internal const string SanitizeAssemblyInfoRegexPattern = "[^0-9A-Za-z-.+]" ;
244+
234245 [ GeneratedRegex ( AssemblyVersionRegexPattern , Options ) ]
235246 public static partial Regex AssemblyVersionRegex ( ) ;
236247
@@ -251,6 +262,9 @@ internal static partial class Output
251262
252263 [ GeneratedRegex ( SanitizeParticipantRegexPattern , Options ) ]
253264 public static partial Regex SanitizeParticipantRegex ( ) ;
265+
266+ [ GeneratedRegex ( SanitizeAssemblyInfoRegexPattern , RegexOptions . IgnorePatternWhitespace | Options ) ]
267+ public static partial Regex SanitizeAssemblyInfoRegex ( ) ;
254268 }
255269
256270 internal static partial class VersionCalculation
0 commit comments