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

pcreGenExecOptBits

pcreGenExecOptBits( 
[ ?anchored g_setAnchoredp ]
[ ?notbol   g_setNotbolp ]
[ ?noteol   g_setNoteolp ]
[ ?notempty g_setNotemptyp ]
[ ?partial  g_setPartialp ]
)
=> x_resultOptBits

Description

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

Arguments

?anchored g_setAnchoredp

When not nil, PCRE constrains the match to the first matching point in the pcreExecute function.
If you compiled a pattern using the PCRE_ANCHORED option, or if the pattern was anchored by virtue of its contents, then it must also be anchored at matching time.

?notbol g_setNotbolp

When not nil, the first character of the subject string is not the beginning of a line such that the circumflex metacharacter ^ does not match before it. If you enable this option without setting the PCRE_MULTILINE option (at compile time), the circumflex metacharacter never results in a match.
This option affects the behavior of ^ only; it does not affect the behavior of \A.

?noteol g_setNoteolp

When not nil, the end of the subject string is not the end of a line such that the dollar sign metacharacter $ does not match it nor does it match a newline character immediately before it (except if you have set the PCRE_MULTILINE option). If you enable this option without setting the PCRE_MULTILINE option (at compile time), the dollar sign metacharacter never results in a match.
This option affects the behavior of $ only; it does not affect the behavior of \Z or \z.

?notempty g_setNotemptyp

When not nil, an empty string is not a valid match. PCRE attempts to match any alternatives in the pattern. If all the alternatives match the empty string, the entire match fails.
For example, if you do not set this option, when PCRE applies the following sequence to a string that does not begin with a or b, it matches the empty string at the start of the subject:

a?b?

If you set this option, an empty string is not a valid match; PCRE searches further into the string for occurrences of a or b.

?partial g_setPartialp

When not nil, the function returns PCRE_ERROR_PARTIAL instead of PCRE_ERROR_NOMATCH in the case of a partial match. A partial match occurs when PCRE encounters the end of a subject string before it can match the complete pattern.    You may not use this option with all patterns. The following restrictions apply:
You may not specify quantified atom matches to search for repeated single characters or repeated single metasequences where the maximum quantity is greater than one. However, you may specify quantifiers with any values after parentheses. For example:

Use (a){2,4} instead of a{2,4}.
Use (\d)+ instead of     \d+.

Value Returned

x_resultOptBits

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

Examples

comPat = pcreCompile( "^\\d?\\d(jan | feb | mar | apr | may | jun)\\d\\d$/" )
=> pcreobj@0x27d0d8
pcreExecute( comPat "25jun3" pcreGenExecOptBits(?partial t) )
=> 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

pcreGenCompileOptBits

pcreMatchAssocList


Return to top
 ⠀
X