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

推荐订阅源

M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
S
Schneier on Security
aimingoo的专栏
aimingoo的专栏
T
Troy Hunt's Blog
U
Unit 42
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
H
Heimdal Security Blog
H
Hacker News: Front Page
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Cloudbric
Cloudbric
Google DeepMind News
Google DeepMind News
C
Cisco Blogs
The Cloudflare Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
F
Fortinet All Blogs
N
News | PayPal Newsroom
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
N
News and Events Feed by Topic
Security Archives - TechRepublic
Security Archives - TechRepublic
Forbes - Security
Forbes - Security
Simon Willison's Weblog
Simon Willison's Weblog
F
Full Disclosure
The Register - Security
The Register - Security
L
LINUX DO - 热门话题
Webroot Blog
Webroot Blog
Google Online Security Blog
Google Online Security Blog
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
Intezer
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
云风的 BLOG
云风的 BLOG
博客园 - 叶小钗
T
Threatpost
Spread Privacy
Spread Privacy
小众软件
小众软件
AWS News Blog
AWS News Blog
S
Secure Thoughts
S
Security @ Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks

博客园 - Ekin.S.Sun

document.execCommand Web文件ContentType类型大全 ArcGIS符号库制作过程说明 JavaScript中的一些重要却容易被忽视的东西 AJAX and the ASP.NET 2.0 Callback Framework My heart hurt:( Working with the ArcGIS Server ArcObjects API : ArcObjects API Js网页打印处理 c#和js的交互(转) MapInfo格式到ArcGIS格式的转换方法 ArcGIS Server 9.2建立的web Application实现打印的一篇文章。 .net学习站点推荐 AJAX .Net组件用户指南(译文&原文) New characteristic of Visual Studio 2005 ASP.NET中常用发送邮件功能代码总结 ASP.NET系统用户权限设计与实现 how to use Form Authentication in ASP.NET. web.config文件详解 [转] 软件测试的一些认识
C#常用正则表达式
Ekin.S.Sun · 2007-07-30 · via 博客园 - Ekin.S.Sun

C#常用正则表达式

"^\d+$"  //非负整数(正整数 + 0 

"^[0-9]*[1-9][0-9]*$"  //正整数 

"^((-\d+)|(0+))$"  //非正整数(负整数 + 0 

"^-[0-9]*[1-9][0-9]*$"  //负整数 

"^-?\d+$"    //整数 

"^\d+(\.\d+)?$"  //非负浮点数(正浮点数 + 0 

"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"  //正浮点数 

"^((-\d+(\.\d+)?)|(0+(\.0+)?))$"  //非正浮点数(负浮点数 + 0 

"^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$"  //负浮点数 

"^(-?\d+)(\.\d+)?$"  //浮点数 

"^[A-Za-z]+$"  //26个英文字母组成的字符串 

"^[A-Z]+$"  //26个英文字母的大写组成的字符串 

"^[a-z]+$"  //26个英文字母的小写组成的字符串 

"^[A-Za-z0-9]+$"  //由数字和26个英文字母组成的字符串 

"^\w+$"  //由数字、26个英文字母或者下划线组成的字符串 

"^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"    //email地址 

"^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$"  //url 

只能输入数字:“^[0-9]*$

只能输入n位的数字:“^\d{n}$

只能输入至少n位数字:“^\d{n,}$

只能输入m-n位的数字:“^\d{m,n}$

只能输入零和非零开头的数字:“^(0|[1-9][0-9]*)$

只能输入有两位小数的正实数:“^[0-9]+(.[0-9]{2})?$

只能输入有1-3位小数的正实数:“^[0-9]+(.[0-9]{1,3})?$

只能输入非零的正整数:“^\+?[1-9][0-9]*$

只能输入非零的负整数:“^\-[1-9][0-9]*$

只能输入长度为3的字符:“^.{3}$

只能输入由26个英文字母组成的字符串:“^[A-Za-z]+$

只能输入由26个大写英文字母组成的字符串:“^[A-Z]+$

只能输入由26个小写英文字母组成的字符串:“^[a-z]+$

只能输入由数字和26个英文字母组成的字符串:“^[A-Za-z0-9]+$

只能输入由数字、26个英文字母或者下划线组成的字符串:“^\w+$

验证用户密码:^[a-zA-Z]\w{5,17}$”正确格式为:以字母开头,长度在6-18之间,

只能包含字符、数字和下划线。

验证是否含有^%&',;=?$\"等字符:“[^%&',;=?$\x22]+

只能输入汉字:“^[\u4e00-\u9fa5],{0,}$

验证Email地址:“^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$

验证InternetURL:“^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$

验证电话号码:“^(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}$

正确格式为:“XXXX-XXXXXXX”,“XXXX-XXXXXXXX”,“XXX-XXXXXXX”,

XXX-XXXXXXXX”,“XXXXXXX”,“XXXXXXXX”。

验证身份证号(15位或18位数字):“^\d{15}|\d{}18$

验证一年的12个月:“^(0?[1-9]|1[0-2])$”正确格式为:“01-09”和“1”“12

验证一个月的31天:“^((0?[1-9])|((1|2)[0-9])|30|31)$

正确格式为:“01”“09”和“1”“31”。