Skip to content

Commit ebe272a

Browse files
committed
minor change
1 parent e474ba3 commit ebe272a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class SemanticVersion : IFormattable, IComparable<SemanticVersion>, IEqua
1111

1212
private static readonly Regex ParseSemVer = new(
1313
@"^(?<SemVer>(?<Major>\d+)(\.(?<Minor>\d+))?(\.(?<Patch>\d+))?)(\.(?<FourthPart>\d+))?(-(?<Tag>[^\+]*))?(\+(?<BuildMetaData>.*))?$",
14-
RegexOptions.Compiled);
14+
RegexOptions.Compiled | RegexOptions.IgnoreCase);
1515

1616
public long Major;
1717
public long Minor;

src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionPreReleaseTag.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ namespace GitVersion;
88
public class SemanticVersionPreReleaseTag :
99
IFormattable, IComparable<SemanticVersionPreReleaseTag>, IEquatable<SemanticVersionPreReleaseTag?>
1010
{
11+
private static readonly Regex ParseRegex = new(
12+
@"(?<name>.*?)\.?(?<number>\d+)?$",
13+
RegexOptions.Compiled | RegexOptions.IgnoreCase);
14+
1115
private static readonly LambdaEqualityHelper<SemanticVersionPreReleaseTag> EqualityHelper =
1216
new(x => x.Name, x => x.Number);
1317

@@ -67,7 +71,7 @@ public static SemanticVersionPreReleaseTag Parse(string? preReleaseTag)
6771
return new SemanticVersionPreReleaseTag();
6872
}
6973

70-
var match = Regex.Match(preReleaseTag, @"(?<name>.*?)\.?(?<number>\d+)?$");
74+
var match = ParseRegex.Match(preReleaseTag);
7175
if (!match.Success)
7276
{
7377
// TODO check how to log this

0 commit comments

Comments
 (0)