Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Foundation/NSRegularExpression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ open class NSRegularExpression: NSObject, NSCopying, NSCoding {
/* An instance of NSRegularExpression is created from a regular expression pattern and a set of options. If the pattern is invalid, nil will be returned and an NSError will be returned by reference. The pattern syntax currently supported is that specified by ICU.
*/

public init(pattern: String, options: Options) throws {
public init(pattern: String, options: Options = []) throws {
var error: Unmanaged<CFError>?
#if os(OSX) || os(iOS)
let opt = _CFRegularExpressionOptions(rawValue: options.rawValue)
Expand Down
2 changes: 1 addition & 1 deletion TestFoundation/TestNSRegularExpression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TestNSRegularExpression : XCTestCase {
do {
let str = NSString(string: searchString)
var range = NSMakeRange(0, str.length)
let regex = try NSRegularExpression(pattern: patternString, options: [])
let regex = try NSRegularExpression(pattern: patternString)
do {
let lookingRange = regex.rangeOfFirstMatch(in: searchString, options: .anchored, range: range)
let matchRange = regex.rangeOfFirstMatch(in: searchString, options: [], range: range)
Expand Down