 let anchoredPattern = Regex(pattern: "/\\A\\s*(\(pattern.pattern))?\\s*\\z/")
 
 extension Version {
-    public class func valid(string: String) -> Bool {
+    public static func valid(string: String) -> Bool {
         return anchoredPattern.match(string)
     }
 }

import Foundation


public class Version : Equatable, Comparable {
    public let major: Int
    public let minor: Int?
    public let patch: Int?
    public let prerelease: String?
    public let build: String?
    
    public required init(major: Int = 0, minor: Int? = nil, patch: Int? = nil, prerelease: String? = nil, build: String? = nil) {
        self.major = major
        self.minor = minor
        self.patch = patch

        self.build = build
    }
    
    public init(_ value: String) {
        let parts = pattern.groupsOfFirstMatch(value)
        
        let majorStr = parts[1]
