struct Regexp {
let pattern: String
static func ~= (regexp: Regexp, targetString: String) -> Bool {
return targetString.range(of: regexp.pattern, options: .regularExpression) != nil
}
}
Created
February 6, 2019 02:03
-
-
Save KentarouKanno/8badf40f37fdcaced9ce4a5d0806cc66 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment