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
publicstaticletCaseInsensitive=NSRegularExpressionOptions(rawValue:1 << 0) /* Match letters in the pattern independent of case. */
20
-
publicstaticletAllowCommentsAndWhitespace=NSRegularExpressionOptions(rawValue:1 << 1) /* Ignore whitespace and #-prefixed comments in the pattern. */
21
-
publicstaticletIgnoreMetacharacters=NSRegularExpressionOptions(rawValue:1 << 2) /* Treat the entire pattern as a literal string. */
22
-
publicstaticletDotMatchesLineSeparators=NSRegularExpressionOptions(rawValue:1 << 3) /* Allow . to match any character, including line separators. */
23
-
publicstaticletAnchorsMatchLines=NSRegularExpressionOptions(rawValue:1 << 4) /* Allow ^ and $ to match the start and end of lines. */
24
-
publicstaticletUseUnixLineSeparators=NSRegularExpressionOptions(rawValue:1 << 5) /* Treat only \n as a line separator (otherwise, all standard line separators are used). */
25
-
publicstaticletUseUnicodeWordBoundaries=NSRegularExpressionOptions(rawValue:1 << 6) /* Use Unicode TR#29 to specify word boundaries (otherwise, traditional regular expression word boundaries are used). */
19
+
publicstaticletcaseInsensitive=NSRegularExpressionOptions(rawValue:1 << 0) /* Match letters in the pattern independent of case. */
20
+
publicstaticletallowCommentsAndWhitespace=NSRegularExpressionOptions(rawValue:1 << 1) /* Ignore whitespace and #-prefixed comments in the pattern. */
21
+
publicstaticletignoreMetacharacters=NSRegularExpressionOptions(rawValue:1 << 2) /* Treat the entire pattern as a literal string. */
22
+
publicstaticletdotMatchesLineSeparators=NSRegularExpressionOptions(rawValue:1 << 3) /* Allow . to match any character, including line separators. */
23
+
publicstaticletanchorsMatchLines=NSRegularExpressionOptions(rawValue:1 << 4) /* Allow ^ and $ to match the start and end of lines. */
24
+
publicstaticletuseUnixLineSeparators=NSRegularExpressionOptions(rawValue:1 << 5) /* Treat only \n as a line separator (otherwise, all standard line separators are used). */
25
+
publicstaticletuseUnicodeWordBoundaries=NSRegularExpressionOptions(rawValue:1 << 6) /* Use Unicode TR#29 to specify word boundaries (otherwise, traditional regular expression word boundaries are used). */
@@ -81,7 +81,7 @@ public class NSRegularExpression : NSObject, NSCopying, NSCoding {
81
81
82
82
/* This class method will produce a string by adding backslash escapes as necessary to the given string, to escape any characters that would otherwise be treated as pattern metacharacters.
publicstaticletReportProgress=NSMatchingOptions(rawValue:1 << 0) /* Call the block periodically during long-running match operations. */
94
-
publicstaticletReportCompletion=NSMatchingOptions(rawValue:1 << 1) /* Call the block once after the completion of any matching. */
95
-
publicstaticletAnchored=NSMatchingOptions(rawValue:1 << 2) /* Limit matches to those at the start of the search range. */
96
-
publicstaticletWithTransparentBounds=NSMatchingOptions(rawValue:1 << 3) /* Allow matching to look beyond the bounds of the search range. */
97
-
publicstaticletWithoutAnchoringBounds=NSMatchingOptions(rawValue:1 << 4) /* Prevent ^ and $ from automatically matching the beginning and end of the search range. */
93
+
publicstaticletreportProgress=NSMatchingOptions(rawValue:1 << 0) /* Call the block periodically during long-running match operations. */
94
+
publicstaticletreportCompletion=NSMatchingOptions(rawValue:1 << 1) /* Call the block once after the completion of any matching. */
95
+
publicstaticletanchored=NSMatchingOptions(rawValue:1 << 2) /* Limit matches to those at the start of the search range. */
96
+
publicstaticletwithTransparentBounds=NSMatchingOptions(rawValue:1 << 3) /* Allow matching to look beyond the bounds of the search range. */
97
+
publicstaticletwithoutAnchoringBounds=NSMatchingOptions(rawValue:1 << 4) /* Prevent ^ and $ from automatically matching the beginning and end of the search range. */
/* 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 rangeAtIndex:0) and any capture group ranges are given by rangeAtIndex: for indexes from 1 to numberOfCaptureGroups. {NSNotFound, 0} is used if a particular capture group does not participate in the match.
/* 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.
/* 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.
/* This class method will produce a string by adding backslash escapes as necessary to the given string, to escape any characters that would otherwise be treated as template metacharacters.
0 commit comments