summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-08-02 02:36:55 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-08-02 02:36:55 -0400
commit7976df856578045b87e17a3d0ea5074715445622 (patch)
tree04610165650f87491f4038207b6e65adade453f1 /src
parenta15a2c5d092ca4608e8b85520443aae39063a11f (diff)
downloadSMAPI-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.cs2
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);
/*********