Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
443 B
3
Indexable
Never
Validator.register('alphaNumericCheck', function (value, requirement) {
    // Regex to detect HTML tag pattern
    var htmlPattern = /<[^>]+>/;
    // alphanumeric check pattern
    var alphaNumericPattern = /^[A-Za-z0-9 ,.?'#^*~]+$/;

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


update the above code to validate for below symbols as well

[a-z][A-Z][0-9][\n…—%&(),.;:'"-+$“”’•#/<>@]
Leave a Comment