Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

pcreGenCompileOptBits

pcreGenCompileOptBits( 
[ ?caseLess  g_setCaseLessp ]
[ ?multiLine g_setMultiLinep ]
[ ?dotAll    g_setDotAllp ]
[ ?extended  g_setExtendedp ]
[ ?anchored  g_setAnchoredp ]
[ ?dollar_endonly g_setDollarEndonlyp ]
[ ?ungreedy  g_setUngreedyp ]
[ ?no_auto_capture g_setNoAutoCapturep ]
[ ?firstline g_setFirstlinep ]
) 
=> x_resultOptBits

Description

Generates bitwise inclusive OR—bor()—of zero or more independent option bits that affect compilation so that you can specify them symbolically in the pcreCompile function. If you call pcreGenCompileOptBits with no arguments, the function returns a zero (options have their default settings).

Arguments

?caseLess g_setCaseLessp

When not nil, letters in the pattern match both upper and lower case letters. Setting this bit is equivalent to using Perl's /i option. You can change this setting within a pattern using (?i)..

?multiLine g_setMultiLinep

When not nil, each newline in the subject string defines a line of characters for which the start-of-line metacharacter (^) matches at the start of the line and the end-of-line metacharacter ($) matches at the end of the line.
By default, PCRE treats the subject string as a single line of characters, even if it contains newlines, such that the start-of-line metacharacter (^) matches only at the start of the string and the end-of-line metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY is set).

?dotAll g_setDotAllp

When not nil, a dot metacharater in the pattern matches all characters, including newlines. Without it, newlines are excluded.
Setting this bit is equivalent to using Perl's /s option. You can change this setting within a pattern using (?s). A negative class such as [^a] always matches a newline character, independent of whether this bit is set or not.

?extended g_setExtendedp

When not nil, PCRE ignores whitespace data characters in the pattern except when they are escaped or inside a character class.
Whitespace does not include the VT character (code 11). PCRE also ignores characters between an unescaped # outside a character class and the next newline character, inclusive.
Setting this bit is equivalent to using Perl's /x option. You can change this setting within a pattern using (?x).
You can use this setting to include comments (data characters only) inside complicated patterns. You may not use whitespace characters in special character sequences in a pattern, such as (?( which introduces a conditional subpattern.

?anchored g_setAnchoredp

When not nil, PCRE constrains the match to the first matching point in the subject string. You can achieve this same effect using appropriate constructs in the pattern itself.

?dollar_endonly g_setDollarEndonlyp

When not nil, a dollar metacharacter in the pattern matches at the end of the subject string only. Without this option, a dollar metacharacter also matches immediately before the final character if it is a newline (but not before any other newlines). PCRE ignores this setting if you specify PCRE_MULTILINE.

?ungreedy g_setUngreedyp

When not nil, PCRE inverts the greed of quantifiers so that they are not greedy by default. You can force a quantifier to become greedy by putting ? after it. You can change this setting within a pattern using (?U).

?no_auto_capture g_setNoAutoCapturep

When not nil, If you set this bit, you are disabling the use of numbered capturing parentheses in a pattern. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but you can still use named parentheses for capturing (and they acquire numbers in the usual way).

?firstline g_setFirstlinep

When not nil, PCRE requires an unanchored pattern to match before or at the first newline character in the subject string; the matched text may continue over the newline.

Value Returned

x_resultOptBits

Bitwise inclusive OR— bor()—of zero or more independent option bits that affect pattern compilation.

Examples

comPat1 = pcreCompile( "^abc$"
pcreGenCompileOptBits(?dollar_endonly t ?multiLine t) )
= > pcreobj@0x27d060
pcreExecute( comPat1 "abc\ndef")
=> t
pcreMatchAssocList("^[a-z][0-9]*$"
'((abc "ascii") ("123" "number") ("yy\na123" "alphanum") (a12z "ana"))
pcreGenCompileOptBits(?multiLine t) pcreGenExecOptBits( ?notbol t) )
=> (("yy\na123" "alphanum"))

Related Topics

String Functions

pcreCompile

pcreExecute

pcreGenExecOptBits

pcreMatchAssocList


Return to top
 ⠀
X