[Pitch] Regular Expression Literals

I'm as enthusiastic as anybody about there being a case for more support for using regular expressions in Swift but I'm really not at all sure picking up the / delimiter syntax just because it has a precedent in Perl is a good direction lexically for Swift. At a minimum we should be talking about some sort of #/regex/# syntax or I simply don't see how it is going to be parsable and unambiguous. This is from someone who coded Perl for a living for 15 years. Frequently you wanted to have / inside regexes and I don't see how the lexer could decide when encountering a / followed by practically anything it could know it happens to be a regular expression.

5 Likes