Function pattern

  • Create a validator that checks if the string matches a regular expression.

    Returns

    A validator that checks if the string matches the regular expression.

    Parameters

    • regex: RegExp

      The regular expression to match against.

    • message: string | MessageResolver<RegExp>

      The error message to use if the string does not match the regular expression.

    Returns Validator<string>

Generated using TypeDoc