Contents

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 OR operator.

  • error:

    An out value that returns any error encountered during initialization. Returns an NSError object if the regular expression pattern is invalid; otherwise returns nil.

Return Value

An instance of NSRegularExpression for the specified regular expression and options.

See Also

Creating Regular Expressions