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

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

博客园 - 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之外