regularExpressionWithPattern:options:error:
Creates an NSRegularExpression instance with the specified regular expression pattern and options.
Declaration
+ (NSRegularExpression *) regularExpressionWithPattern:(NSString *) pattern options:(NSRegularExpressionOptions) options error:(NSError **) error;Parameters
- pattern:
The regular expression pattern to compile.
- options:
The matching options. See Options Swift.struct for possible values. The values can be combined using the C-bitwise
ORoperator. - error:
An out value that returns any error encountered during initialization. Returns an
NSErrorobject if the regular expression pattern is invalid; otherwise returnsnil.
Return Value
An instance of NSRegularExpression for the specified regular expression and options.