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.
152
152
*/
153
153
154
-
publicfunc enumerateMatches(in string:String, options:NSMatchingOptions, range:NSRange, using block:@escaping(TextCheckingResult?,NSMatchingFlags,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
154
+
publicfunc enumerateMatches(in string:String, options:NSMatchingOptions, range:NSRange, using block:@escaping(NSTextCheckingResult?,NSMatchingFlags,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
/* For clients implementing their own replace functionality, this is a method to perform the template substitution for a single result, given the string from which the result was matched, an offset to be added to the location of the result in the string (for example, in case modifications to the string moved the result since it was matched), and a replacement template.
266
266
*/
267
-
publicfunc replacementString(for result:TextCheckingResult, in string:String, offset:Int, template templ:String)->String{
267
+
publicfunc replacementString(for result:NSTextCheckingResult, in string:String, offset:Int, template templ:String)->String{
268
268
// ??? need to consider what happens if offset takes range out of bounds due to replacement
/* A result must have at least one range, but may optionally have more (for example, to represent regular expression capture groups). The range at index 0 always matches the range property. Additional ranges, if any, will have indexes from 1 to numberOfRanges-1. */
0 commit comments