0

Code:

    let regex = try NSRegularExpression(pattern: "([+-]?\\d+(\\.\\d+)?)[Ee]([+-]?\\d+)", options: [])

Now options should be of the type NSRegularExpressionOptions, how does [] conform to that?

Martin R
  • 510,973
  • 84
  • 1,183
  • 1,314
qed
  • 21,094
  • 18
  • 110
  • 180
  • Check this http://stackoverflow.com/questions/24066170/how-to-create-ns-options-style-bitmask-enumerations-in-swift – Cristik Jan 18 '16 at 13:14
  • The reason is that OptionSetType conforms to ArrayLiteralConvertible, compare http://stackoverflow.com/questions/32169597/swift-2-0-nil-or-0-enum-arguments or http://stackoverflow.com/questions/33863236/in-swift-what-does-this-specific-syntax-mean. – Martin R Jan 18 '16 at 13:22

0 Answers0