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

    Example

    // 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
    • Optional options: ValidationOptions

    Returns PropertyDecorator

  • Parameters

    • pattern: string
    • Optional modifiers: string
    • Optional options: ValidationOptions

    Returns PropertyDecorator