Skip to content

EvalRegexAssertion

PromptScript API


Defined in: core/src/types/eval.ts:143

Passes when the pattern matches the target.

Extends

Properties

field?

optional field?: string

Defined in: core/src/types/eval.ts:109

Output property the assertion reads; absent means the whole response text

Inherited from

EvalAssertionBase.field


flags?

optional flags?: string

Defined in: core/src/types/eval.ts:156

Regular expression flags, any of i, m, s and u, each at most once.

Pattern

^(?!.(.).\1)[imsu]{0,4}$


id

id: string

Defined in: core/src/types/eval.ts:107

Assertion id, unique in the suite.

Pattern

^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$

Example

"decision-matches"

Inherited from

EvalAssertionBase.id


kind

kind: "regex"

Defined in: core/src/types/eval.ts:144


negate?

optional negate?: boolean

Defined in: core/src/types/eval.ts:146

Inverts the result


pattern

pattern: string

Defined in: core/src/types/eval.ts:151

Regular expression source.

Example

"\\bguarantee(d)?\\b"