is-regexp-x
Is this value a JS regex?
Version: 2.2.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(value)
⇒ boolean
⏏
This method tests if a value is a regex.
Kind: Exported function
Returns: boolean
- true
if value is a regex; otherwise false
.
Param | Type | Description |
---|
value | * | The value to test. |
Example
var isRegex = require('is-regexp-x');
isRegex(undefined);
isRegex(null);
isRegex(false);
isRegex(true);
isRegex(42);
isRegex('foo');
isRegex(function () {});
isRegex([]);
isRegex({}));
isRegex(/a/g);
isRegex(new RegExp('a', 'g'));