Swift should offer a regex matching operator

Originator:kristopherdjohnson
Number:rdar://17257083 Date Originated:10-Jun-2014 04:51 PM
Status:Duplicate/15819473 Resolved:Duplicate/15819473
Product:Developer Tools Product Version:Xcode 66
Classification:Feature (New) Reproducible:N/A
 
Summary:
The Cocoa frameworks provide the NSRegularExpression class for performing regular-expression matching. This class works, but setting up a regex and matching requires a lot of code.

It would be nice if Swift offered regex-matching operators similar to those of Perl, Ruby, or JavaScript.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Version:
Xcode 6

Notes:
For a simple implementation of a "=~" operator in Swift, see https://gist.github.com/JimRoepcke/d68dd41ee2fedc6a0c67

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!