Method RegEx():setOptions() Foundation

Sets PCRE compilation options directly.

Syntax
:setOptions( <nOptions> ) --> self
Parameters
<nOptions>
PCRE compilation options specified as a bitmask. The following section lists the #define directives for the supported PCRE options. If more than one option is to be set, the options must be added together.
#define PCRE_ANCHORED           0x00000010  // Force pattern anchoring 
#define PCRE_AUTO_CALLOUT       0x00004000  // Compile automatic callouts 
#define PCRE_BSR_ANYCRLF        0x00800000  // \R matches only CR, LF, or CRLF 
#define PCRE_BSR_UNICODE        0x01000000  // \R matches all Unicode line endings 
#define PCRE_DOLLAR_ENDONLY     0x00000020  // $ not to match newline at end 
#define PCRE_DOTALL             0x00000004  // See method :setDotAll() 
// . matches anything including NL 
#define PCRE_DUPNAMES           0x00080000  // Allow duplicate names for subpatterns 
#define PCRE_EXTENDED           0x00000008  // See method :setExtended() 
// Ignore white space and # comments 
#define PCRE_EXTRA              0x00000040  // PCRE extra features 
// (not much use currently) 
#define PCRE_FIRSTLINE          0x00040000  // Force matching to be before newline 
#define PCRE_JAVASCRIPT_COMPAT  0x02000000  // JavaScript compatibility 
#define PCRE_MULTILINE          0x00000002  // See method :setMultiline() 
// ^ and $ match newlines within data 
#define PCRE_NEVER_UTF          0x00010000  // Lock out UTF, e.g. via (*UTF) 
// Recognize any Unicode newline sequence 
// Recognize CR, LF, and CRLF as newline 
#define PCRE_NEWLINE_ANYCRLF    0x00500000  // Recognize CR, LF, and CRLF as newline 
// sequences 
#define PCRE_NEWLINE_CR         0x00100000  // Set CR as the newline sequence 
#define PCRE_NEWLINE_CRLF       0x00300000  // Set CRLF as the newline sequence 
#define PCRE_NEWLINE_LF         0x00200000  // Set LF as the newline sequence 
#define PCRE_NO_AUTO_CAPTURE    0x00001000  // Disable numbered capturing parentheses 
// (named ones available) 
#define PCRE_NO_AUTO_POSSESS    0x00020000  // Disable auto-possessification 
#define PCRE_NO_START_OPTIMIZE  0x04000000  // Disable match-time start optimizations 
#define PCRE_NO_UTF8_CHECK      0x00002000  // Do not check the pattern for UTF-8 
// validity (only relevant if PCRE_UTF8 is set) 
#define PCRE_UCP                0x20000000  // Use Unicode properties for \d, \w, etc. 
#define PCRE_UNGREEDY           0x00000200  // See method :setUngreedy() 
// Invert greediness of quantifiers 
#define PCRE_UTF8               0x00000800  // See method :setUnicode() 
// Run in pcre_compile() UTF-8 mode 
Return

This method returns self.

Description

Directly sets the PCRE compilation options as a bitmask. This provides access to all PCRE options, including those not covered by the standard configuration methods.

Note: calling this method invalidates options previously set with the standard configuration methods :setIgnoreCase(), :setMultiline(), :setDotAll(), :setExtended(), :setUnicode() and :setUngreedy(). For example, if multiline mode had been enabled via :setMultiline(), the corresponding bit (PCRE_MULTILINE) must also be set in the bitmask in the <nOptions> parameter for multiline mode to still be active after a call to :setOptions().

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.