Skip to content

Instantly share code, notes, and snippets.

View gist:e48a88fc3d153f5692ae
Might be this will helpful to remove error:
func isMatch(regex: String, options: NSRegularExpressionOptions) -> Bool
{
var error: NSError?
var exp = NSRegularExpression(pattern: regex, options: options, error: &error)
if let error = error {
println(error.description)
}
var matchCount = exp?.numberOfMatchesInString(self, options: nil, range: NSMakeRange(0, self.length))