fn

guessValidValueByRegExp

tested

Conform a value to a single-RegExp mask: keep the greedy prefix for which the value still matches, dropping the first character that breaks the pattern.

Signature

ts
export function guessValidValueByRegExp(state: ElementState, mask: RegExp): ElementState{ ... }

Parameters

ParameterTypeDescription
stateElementState
maskRegExp

Returns

ElementState
PropertyTypeDescription
valuestring
selectionSelectionRange