diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-02 02:24:02 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-02 02:24:02 -0400 |
commit | a15a2c5d092ca4608e8b85520443aae39063a11f (patch) | |
tree | fd0c43d165c0b90167576e33e1e7b8f03df5cbd6 | |
parent | 937750f10085840a0b0c84da516c7544594c812b (diff) | |
download | SMAPI-a15a2c5d092ca4608e8b85520443aae39063a11f.tar.gz SMAPI-a15a2c5d092ca4608e8b85520443aae39063a11f.tar.bz2 SMAPI-a15a2c5d092ca4608e8b85520443aae39063a11f.zip |
tweak semantic version regex to fix unnecessary capturing groups
-rw-r--r-- | src/StardewModdingAPI/SemanticVersion.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/SemanticVersion.cs b/src/StardewModdingAPI/SemanticVersion.cs index 782a962b..58f24503 100644 --- a/src/StardewModdingAPI/SemanticVersion.cs +++ b/src/StardewModdingAPI/SemanticVersion.cs @@ -17,7 +17,7 @@ namespace StardewModdingAPI /// - allows hyphens in prerelease tags as synonyms for dots (like "-unofficial-update.3"); /// - doesn't allow '+build' suffixes. /// </remarks> - private static readonly Regex Regex = new Regex(@"^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)(\.(?<patch>0|[1-9]\d*))?(?:-(?<prerelease>([a-z0-9]+[\-\.]?)+))?$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture); + private static readonly Regex Regex = new Regex(@"^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)(?:\.(?<patch>0|[1-9]\d*))?(?:-(?<prerelease>(?:[a-z0-9]+[\-\.]?)+))?$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture); /********* |