You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* The fundamental matching method on NSRegularExpression is a block iterator. There are several additional convenience methods, for returning all matches at once, the number of matches, the first match, or the range of the first match. Each match is specified by an instance of NSTextCheckingResult (of type NSTextCheckingTypeRegularExpression) in which the overall match range is given by the range property (equivalent to range at:0) and any capture group ranges are given by range at: for indexes from 1 to numberOfCaptureGroups. {NSNotFound, 0} is used if a particular capture group does not participate in the match.
178
178
*/
179
179
180
-
publicfunc enumerateMatches(in string:String, options:NSMatchingOptions, range:NSRange, using block:@escaping(NSTextCheckingResult?,NSMatchingFlags,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
180
+
publicfunc enumerateMatches(in string:String, options:NSMatchingOptions=[], range:NSRange, using block:@escaping(NSTextCheckingResult?,NSMatchingFlags,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
/* NSRegularExpression also provides find-and-replace methods for both immutable and mutable strings. The replacement is treated as a template, with $0 being replaced by the contents of the matched range, $1 by the contents of the first capture group, and so on. Additional digits beyond the maximum required to represent the number of capture groups will be treated as ordinary characters, as will a $ not followed by digits. Backslash will escape both $ and itself.
0 commit comments