One Logo Pool Ball
Foundation · IOS API REFERENCE

NSRegularExpression

class · iOS 4.0+ · SDK 27.1

class NSRegularExpression

Members (13)

static · iOS 4.0+

escapedPattern

TypeScript
static escapedPattern(string: string): string
Swift declaration
class func escapedPattern(for string: String) -> String
static

escapedTemplate

TypeScript
static escapedTemplate(string: string): string
Swift declaration
class func escapedTemplate(for string: String) -> String
method

firstMatch

TypeScript
firstMatch(string: string, options: NSRegularExpression_MatchingOptions, range: SDKHandle): (NSTextCheckingResult) | null
Swift declaration
func firstMatch(in string: String, options: NSRegularExpression.MatchingOptions = [], range: NSRange) -> NSTextCheckingResult?
init · iOS 4.0+

init

TypeScript
static init(pattern: string, options?: NSRegularExpression_Options): NSRegularExpression
Swift declaration
init(pattern: String, options: NSRegularExpression.Options = []) throws
method

matches

TypeScript
matches(string: string, options: NSRegularExpression_MatchingOptions, range: SDKHandle): Array<NSTextCheckingResult>
Swift declaration
func matches(in string: String, options: NSRegularExpression.MatchingOptions = [], range: NSRange) -> [NSTextCheckingResult]
method

numberOfMatches

TypeScript
numberOfMatches(string: string, options: NSRegularExpression_MatchingOptions, range: SDKHandle): number
Swift declaration
func numberOfMatches(in string: String, options: NSRegularExpression.MatchingOptions = [], range: NSRange) -> Int
method

rangeOfFirstMatch

TypeScript
rangeOfFirstMatch(string: string, options: NSRegularExpression_MatchingOptions, range: SDKHandle): SDKHandle
Swift declaration
func rangeOfFirstMatch(in string: String, options: NSRegularExpression.MatchingOptions = [], range: NSRange) -> NSRange
method

replaceMatches

TypeScript
replaceMatches(string: NSMutableString, options: NSRegularExpression_MatchingOptions, range: SDKHandle, templ: string): number
Swift declaration
func replaceMatches(in string: NSMutableString, options: NSRegularExpression.MatchingOptions = [], range: NSRange, withTemplate templ: String) -> Int
method

replacementString

TypeScript
replacementString(result: NSTextCheckingResult, string: string, offset: number, templ: string): string
Swift declaration
func replacementString(for result: NSTextCheckingResult, in string: String, offset: Int, template templ: String) -> String
method

stringByReplacingMatches

TypeScript
stringByReplacingMatches(string: string, options: NSRegularExpression_MatchingOptions, range: SDKHandle, templ: string): string
Swift declaration
func stringByReplacingMatches(in string: String, options: NSRegularExpression.MatchingOptions = [], range: NSRange, withTemplate templ: String) -> String
get · iOS 4.0+

numberOfCaptureGroups

TypeScript
get numberOfCaptureGroups(): number
Swift declaration
var numberOfCaptureGroups: Int { get }
get · iOS 4.0+

options

TypeScript
get options(): NSRegularExpression_Options
Swift declaration
var options: NSRegularExpression.Options { get }
get · iOS 4.0+

pattern

TypeScript
get pattern(): string
Swift declaration
var pattern: String { get }

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSRegularExpression.enumerateMatches(in:options:range:using:)

The iOS SDK compiler rejected this binding: cannot convert value of type '(NSTextCheckingResult?, NSRegularExpression.MatchingFlags, UnsafeMutablePointer<ObjCBool>) -> Void' to expected argument type '(NSTextCheckingResult?, Int, UnsafeMutablePointer<ObjCBool>) -> Void'

NSRegularExpression.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All Foundation types →