npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

regular-javascript

v1.0.7

Published

常见的正则检验

Downloads

12

Readme

regular-javascript

注意:1.0.3版本后默认传入空string,则返回false,在1.0.2版本传入空string会返回空string

注意:1.0.6版本后仅支持ES module导出(本人偷懒,有空再加吧,要require导入的可以借助第三方插件转。)

方法

isEmail:是否邮箱,
isUrl:是否url地址,
isDomain:是否域名,
isIp:是否ip地址,
isCreditCard:是否信用卡,
isEnNo:是否字母和数字,
isNumber:是否数字,
isHtml:是否是否HTML标签,
isPhone:是否手机号,
isDateStr:是否年月日 2000-01-01 or 2001-1-1
isTel:是否座机电话,
isIDCard:是否2019身份证校验15位18位,
isZH:是否全部中文,
isDecimal:是否小数,
isEN:是否全英文,
isSmallEn:是否小写字母,
isBigEn:是否大写字母,
isIpv4:是否ipv4校验,
isIpv6: 是否ipv6,
isWeChat:是否微信号校验,
isPostalCode:是否邮政编码校验,
isZHNumber:是否中文+数字,
isNotEn:是否不是字母,
isThunder: 是否迅雷链接,
isEd2k: 是否ed2k链接,
isMagnet: 是否磁力链接,
isSubnetMask: 是否子网掩码,
isVideoLink: 是否视频链接,
isImageLink: 是否图片链接,
isHours24:是否24小时制时间(HH:mm:ss),
isHours12:是否12小时制时间(hh:mm:ss),
isBase64: 是否base64格式,

###安装

npm install regular-javascript

###引入

import * as regular from 'regular-javascript' 全部引入
import { isEmail, isUrl } from 'regular-javascript' 部分引入

###用法

全部引入用法:regular.isEmail.test(data)
部分引入用法:isEmail.test(data)