惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - Danys

Ubuntu10.10 安装 Discuz 在Windows 7 的Windows Virtual PC上装 Ubuntu 10.10 使用Carbide.c++搭建S60开发环境 手机开发入门系列 主流智能手机操作系统知多少 VB.NET 转换为 C# ASP.NET 开源 Blog 收集 Vista SP1、VS2008 SP1环境中 localhost无法访问 Vista SP1下,IE8,使用支付宝 C# 写文本文件 C#读取文本文件 【翻译】Technical Overview of DirectAccess in Windows 7 and Windows Server 2008 R2 Silverlight 2 相关资源下载地址 C#读取Excel方法总结 11款完全免费的Web设计工具 Elcomsoft宣称WPA/WPA2无线加密破解速度提高100倍 Microsoft Silverlight 2 正式版本发布 NET 4.0将包含并行扩展 13个大文件邮件传送服务
验证时间的正则表达式
Danys · 2009-09-24 · via 博客园 - Danys

能验证如下格式:

12:30、12:3、12:03、1:03、01:03

JavaScript代码为:

var regexObj= /^((2[0-3])|([0-1][0-9])):[0-5]?[0-9]$/;

alert(regexObj.test("12:20"));

alert(regexObj.test("12:2"));

alert(regexObj.test("12:)"));

alert(regexObj.test("12:d"));

alert(regexObj.test("12:0"));

alert(regexObj.test("12:03"));

alert(regexObj.test("1:03"));

alert(regexObj.test("01:03"));

C#的代码类似,这里就不说了~