I have to detect whether a string contains any special characters. How can I check it? Does Swift support regular expressions?
var characterSet:NSCharacterSet
Depending on the definition of special characters, you could use this:
let chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" chars.canBeConvertedToEncoding(NSASCIIStringEncoding)