Skip to content

API reference > @kontsedal/olas-core > pattern

pattern() function ​

Reject strings that don't match the supplied RegExp.

Signature:

typescript
pattern: (re: RegExp, message?: string) => Validator<string>

Parameters ​

Parameter

Type

Description

re

RegExp

message

string

(Optional)

Returns:

Validator<string>

Released under the MIT License.