diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-02 02:36:55 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-08-02 02:36:55 -0400 |
commit | 7976df856578045b87e17a3d0ea5074715445622 (patch) | |
tree | 04610165650f87491f4038207b6e65adade453f1 /src | |
parent | a15a2c5d092ca4608e8b85520443aae39063a11f (diff) | |
download | SMAPI-7976df856578045b87e17a3d0ea5074715445622.tar.gz SMAPI-7976df856578045b87e17a3d0ea5074715445622.tar.bz2 SMAPI-7976df856578045b87e17a3d0ea5074715445622.zip |
optimise semver regex using atomic groups
Diffstat (limited to 'src')
-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 58f24503..26de3aa8 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); /********* |