System.RegularExpressionsCore.TPerlRegExOptions
Delphi
TPerlRegExOptions = set of (
preCaseLess, // /i -> Case insensitive
preMultiLine, // /m -> ^ and $ also match before/after a newline, not just at the beginning and the end of the string
preSingleLine, // /s -> Dot matches any character, including \n (newline). Otherwise, it matches anything except \n
preExtended, // /x -> Allow regex to contain extra whitespace, newlines and Perl-style comments, all of which will be filtered out
preAnchored, // /A -> Successful match can only occur at the start of the subject or right after the previous match
preUnGreedy, // Repeat operators (+, *, ?) are not greedy by default (i.e. they try to match the minimum number of characters instead of the maximum)
preNoAutoCapture // (group) is a non-capturing group; only named groups capture
);
C++
typedef System::Set<System_Regularexpressionscore__1, System_Regularexpressionscore__1::preCaseLess, System_Regularexpressionscore__1::preNoAutoCapture> TPerlRegExOptions;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
set typedef |
public | System.RegularExpressionsCore.pas System.RegularExpressionsCore.hpp |
System.RegularExpressionsCore | System.RegularExpressionsCore |
Description
Match option enumeration set for the Perl regular expression.
Option | Meaning |
---|---|
|
Tries to match the regex without paying attention to case. If set, 'Bye' will match 'Bye', 'bye', 'BYE' and even 'byE', 'bYe', and so on. Otherwise, only 'Bye' will be matched. Equivalent to Perl's /i modifier. |
|
The ^ (beginning of string) and $ (ending of string) regex operators will also match right after and right before a new line in the Subject string. This effectively treats one string with multiple lines as multiple strings. Equivalent to Perl's /m modifier. |
|
Normally, dot (.) matches anything but a new line (\n). With |
|
Allow the regular expression to contain extra white spaces, new lines, and Perl-style comments, all of which will be filtered out. This is sometimes called "free-spacing mode". |
|
Allows the regular expression to match only at the start of the subject or right after the previous match. |
|
Repeat operators (?, *, +, {num,num}) are greedy by default, for example, they try to match as many characters as possible. Set |
|
Allows the regular expression to capture only named groups. Note that (group) is a non-capturing group. |