Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Latest commit

 

History

History
28 lines (23 loc) · 746 Bytes

regex-type.md

File metadata and controls

28 lines (23 loc) · 746 Bytes

Regex Type

Validates whether the type of an input is regex.

Valid values:

validator.regexType().validate(/^[a-z]/);
validator.regexType().validate(RegExp(/^[a-z]/));
validator.regexType().validate(new RegExp(/^[a-z]/));

Invalid values:

validator.regexType().validate(undefined);
validator.regexType().validate(null);
validator.regexType().validate(true);
validator.regexType().validate(false);
validator.regexType().validate('foo');
validator.regexType().validate(0);
validator.regexType().validate(1);
validator.regexType().validate([]);
validator.regexType().validate({});
validator.regexType().validate(new Array());
validator.regexType().validate(new Object());
validator.regexType().validate(Object.create(null));