String patterns are read as regular expression sources and compiled with default flags; pass a RegExp instead to
choose the flags, u among them. Matching is unanchored, so a pattern constrains the whole value only if it is
anchored explicitly.
Parameters
pattern: string|RegExp|undefined
The pattern the value must match, or undefined to accept any value
Constrains strings to a pattern.
String patterns are read as regular expression sources and compiled with default flags; pass a
RegExpinstead to choose the flags,uamong them. Matching is unanchored, so a pattern constrains the whole value only if it is anchored explicitly.