Options for controlling the behavior of a regular expression pattern can be controlled in two ways. When the method supports it, options may specified by combining RKLRegexOptions flags with the C bitwise OR operator. For example:
The other way is to specify the options within the regular expression itself, of which there are two ways. The first specifies the options for everything following it, and the other sets the options on a per capture group basis. Options are either enabled, or following a -, disabled. The syntax for both is nearly identical:
Option Example Description
(?ixsmw-ixsmw)… (?i)… Enables the RKLCaseless option for everything that follows it. Useful at the beginning of a regular expression to set the desired options.
(?ixsmw-ixsmw:…) (?iw-m:…) Enables the RKLCaseless and RKLUnicodeWordBoundaries options and disables RKLMultiline for the capture group enclosed by the parenthesis.
The following table lists the regular expression pattern option character and its corresponding RKLRegexOptions flag: