• Checks if the given value is a string that does not match the given regular expression.

    // Ensure the value does not start with "foo".
    @NotMatches(/^foo/)
    value: string = 'bar'

    // Ensure the value does not include "foo", ignoring case.
    @NotMatches('foo', 'i')
    value: string = 'bar'

    Parameters

    • pattern: RegExp
    • Optionaloptions: ValidationOptions

    Returns PropertyDecorator

  • Parameters

    • pattern: string
    • Optionalmodifiers: string
    • Optionaloptions: ValidationOptions

    Returns PropertyDecorator