Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
532 B
1
Indexable
Never
Validator.register('alphaNumericCheck', function (value, requirement) {
    // Regex to detect HTML tag pattern
    var htmlPattern = /<[^>]+>/;
    // Updated alphanumeric check pattern with additional symbols, including newline characters
    var alphaNumericPattern = /^[a-zA-Z0-9\n…—%&() ,.;:'"+\$-“”’•#\/<>@?!]+$/;

    return !htmlPattern.test(value) && alphaNumericPattern.test(value);
});



updte the above code to throw error for [a-z][A-Z][0-9][\n…—%&(),.;:'"-+$“”’•#/<>@] and html tags
Leave a Comment