title: NSRegularExpression error, I can't use Regular Expressions
body: <p>I was creating a Regular expression but in can´t solve this problem </p>
  
  <pre><code>class Regex {
      let internalExpression: NSRegularExpression
      let pattern: String
  
      init(_ pattern: String) {
          self.pattern = pattern
          var error: NSError?
          self.internalExpression = NSRegularExpression(pattern: pattern, options: .CaseInsensitive, error: &amp;error)
      }
  
      func test(input: String) -&gt; Bool {
          let matches = self.internalExpression.matchesInString(input, options: nil, range:NSMakeRange(0, countElements(input)))
          return matches.count &gt; 0
      }
  }
  </code></pre>
  
  <p>Here are the errors I got:</p>
  
  <blockquote>
    <p>"Cannot invoke initializer for type 'NSRegularExpression' with an argument list of type '(pattern: String, options: _, error: inout NSError?)'" </p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>"Use of unresolved identifier 'countElements'"</p>
  </blockquote>
  
  <p>I only want to use this: </p>
  
  <pre><code>if usuarioView.text! =~ "/^[a-zA-Z0-9_]{3,30}$/"
  </code></pre>