using Microsoft.AspNetCore.Routing.Constraints; namespace StardewModdingAPI.Web.Framework { /// Constrains a route value to a valid semantic version. internal class VersionConstraint : RegexRouteConstraint { /********* ** Public methods *********/ /// Construct an instance. public VersionConstraint() : base(@"^v(?>(?0|[1-9]\d*))\.(?>(?0|[1-9]\d*))(?>(?:\.(?0|[1-9]\d*))?)(?:-(?(?>[a-z0-9]+[\-\.]?)+))?$") { } } }