Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-313

Move RegularExpression.nsRegularExpression logic into a new NSRegularExpression initializer

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: None
    • Labels:

      Description

      Because NSRegularExpression doesn't quite align with a BSON regular expression, we chose to write our own RegularExpression type and provide facilities on it for converting to an from NSRegularExpression (with some lossiness of options). 

      The NSRegularExpression -> RegularExpression conversion is implemented via an initializer: RegularExpression.init(from regex: NSRegularExpression)

      The opposite conversion is implemented as a computed property on RegularExpression: var nsRegularExpression: NSRegularExpression

      I think it would be more consistent/symmetric to instead add a new convenience initializer to NSRegularExpression via extension that takes in a RegularExpression

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: