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

推荐订阅源

D
DataBreaches.Net
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
腾讯CDC
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学

博客园 - Tommy's Blog

常用的正则表达式字段 BBS List C# Learning Notes SharePoint Portal Server error message Microsoft TechNet中文网络广播 Learning C# Watched .NET componets [Idea] - online english recite Sample web page designers in China My goal 2005 Some google words PDF library JDK 1.5 notable new features.. Windows Scripting Google SEO digest Wallop invitation Favorite .NET open source projects My registered blogs 定制Internet Explorer扩展界面接口
正则表达式学习
Tommy's Blog · 2005-05-04 · via 博客园 - Tommy's Blog

http://spaces.msn.com/members/water100/Blog/cns!1pjjh4A8ZSs9sPXNYrm-6olQ!111.entry

/fo+/ o一个或一个以上
/fo*/ o 零个或一个以上
/fo?/  零个或一个
/tom{1,2}y/ m一个至两个
\s:用于匹配单个空格符,包括tab键和换行符;
\S:用于匹配除单个空格符之外的所有字符;
\d:用于匹配从0到9的数字;
\w:用于匹配字母,数字或下划线字符;
\W:用于匹配所有与\w不匹配的字符;
. :用于匹配除换行符之外的所有字符
(说明:我们可以把\s和\S以及\w和\W看作互为逆运算) 
“^”开始,
“$”结束,
 “\b”目标字符串的开头或结尾的两个边界之一
 “\B”相反
/\bbom/  因为上述正则表达式模式以“\b”定位符开头,所以可以与目标对象中以 “bomb”, 或 “bom”开头的字符串相匹配。
/man\b/  因为上述正则表达式模式以“\b”定位符结尾,所以可以与目标对象中以 “human”, “woman”或 “man”结尾的字符串相匹配。

Decimal (mandatory decimal point) ^(\d)*\.(\d)*$
Decimal (decimal point not mandatory ) ^(\d)*(\.(\d)*)?$
Date (mm/dd/yyyy) or (dd/mm/yyyy) ^(\d){1,2}/(\d){1,2}/(\d){2,4}$
Date (yyyy/mm/dd) ^(\d){2,4}/(\d){1,2}/(\d){1,2}$

/[a-z][A-Z]/
/[^A-C]/ 除A到C之外