title: Check if a string contains at least a upperCase letter, a digit, or a special character in Swift?
body: <p>I am trying to create a method that finds whether a string contains a number , Upper case letter and a special character using regular expression as below </p>
  
  <pre><code> func checkTextSufficientComplexity(var text : String) -&gt; Bool{
  
  
              let capitalLetterRegEx  = "[A-Z]+"
              var texttest = NSPredicate(format:"SELF MATCHES %@", capitalLetterRegEx)
              var capitalresult = texttest.evaluateWithObject("AniP")
              println("\(capitalresult)")
  
  
              let numberRegEx  = "[0-9]+"
              var texttest1 = NSPredicate(format:"SELF MATCHES %@", numberRegEx)
              var numberresult = texttest1.evaluateWithObject(text)
              println("\(numberresult)")
  
  
              let specialCharacterRegEx  = "[.*&amp;^%$#@()/]+"
              var texttest2 = NSPredicate(format:"SELF MATCHES %@", numberRegEx)
  
              var specialresult = texttest2.evaluateWithObject(text)
              println("\(specialresult)")
  
             return capitalresult &amp;&amp; numberresult &amp;&amp; specialresult
  
      }
  </code></pre>
  
  <p>The problem is the below regular expression [A-Z]+ returns true for only e.g AVATAR and returns false for Avatar. I want my regular expression return true if it contains at least one UpperCase in String.</p>