Check string for 1 number, 1 letter and be between 5-15 characters in length
<p>I am using the following extension to make sure a string has at least 1 number, 1 letter and between 5-15 characters in length and I feel that it can be more efficient. Any suggestions?</p>

<p>func checkPassword(password : String) -> Bool{</p>

<pre><code>    if password.characters.count &gt; 15 || password.characters.count &lt; 5 {
        return false
    }


    let capitalLetterRegEx  = ".*[A-Za-z]+.*"
    let texttest = NSPredicate(format:"SELF MATCHES %@", capitalLetterRegEx)
    let capitalresult = texttest.evaluate(with: password)

    let numberRegEx  = ".*[0-9]+.*"
    let texttest1 = NSPredicate(format:"SELF MATCHES %@", numberRegEx)
    let numberresult = texttest1.evaluate(with: password)

    let specialRegEx  = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLKMNOPQRSTUVWXYZ0123456789"
    let texttest2 = NSPredicate(format:"SELF MATCHES %@", specialRegEx)
    let specialresult = !texttest2.evaluate(with: password)




    if !capitalresult || !numberresult || !specialresult  {
        return false
    }

    return true

}
</code></pre>