System.RegularExpressionsCore.TPerlRegExOptions

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

type TPerlRegExOptions = set of (preCaseLess, preMultiLine, preSingleLine, preExtended, preAnchored, preUnGreedy, preNoAutoCapture);

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

preCaseLess

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.

preMultiLine

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.

preSingleLine

Normally, dot (.) matches anything but a new line (\n). With preSingleLine, dot (.) will match anything, including new lines. This allows a multiline string to be regarded as a single entity. Equivalent to Perl's /s modifier. Note that preMultiLine and preSingleLine can be used together.

preExtended

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".

preAnchored

Allows the regular expression to match only at the start of the subject or right after the previous match.

preUnGreedy

Repeat operators (?, *, +, {num,num}) are greedy by default, for example, they try to match as many characters as possible. Set preUnGreedy to use ungreedy repeat operators by default, for example, so that they try to match as few characters as possible.

preNoAutoCapture

Allows the regular expression to capture only named groups. Note that (group) is a non-capturing group.

See Also