【文件属性】:
文件名称:regexp:验证值是否为正则表达式
文件大小:8KB
文件格式:ZIP
更新时间:2021-06-20 13:38:11
Makefile
正则表达式
验证值是否为正则表达式。
安装
$ npm install validate.io-regexp
要在浏览器中使用,请使用 。
用法
var isRegexp = require ( 'validate.io-regexp' ) ;
isRegexp( 值 )
验证value是否为正则表达式。
var value = / \. + / ;
var bool = isRegexp ( value ) ;
// returns true
例子
console . log ( isRegexp ( / \. + / ) ) ;
// returns true
console . log ( isRegexp ( '/\.+/' ) ) ;
// returns false
要从*应用程序目录运行示例代码,
$ node ./examples/index.js
测试
【文件预览】:
regexp-master
----.jshintrc(1KB)
----.gitignore(711B)
----package.json(1KB)
----Makefile(2KB)
----.travis.yml(73B)
----LICENSE(1KB)
----examples()
--------index.js(157B)
----.jshintignore(118B)
----README.md(3KB)
----lib()
--------index.js(711B)
----TODO.md(12B)
----.npmignore(498B)
----.gitattributes(12B)
----test()
--------test.js(821B)
----.editorconfig(169B)