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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - rainbow727

ps-图层调整大小 js 根据关键字,进行mark背景色标记 时间戳转换为时间格式 ps-图层尺寸缩放 ps-窗口缩放比例调整 bug Extjs小例子 ps-填充色 jq 数组对象,重复数据进行合并 ipv4,ipv6起止地址判断,网段判断 HTML li标签排列有空白间隙 Ext.js知识点纪要 PHP 文件内容处理 知识点小纪要 function函数 正则表达式的字符含义 邮箱正则表达式 jQuery相关面试题 js继承
常用正则表达式
rainbow727 · 2016-10-11 · via 博客园 - rainbow727

常用正则表达式

版本:v0.01 (2011-6-7) 整理:deerchao 转载请注明来源

说明:正则表达式通常用于两种任务:1.验证,2.搜索/替换。用于验证时,通常需要在前后分别加上^和$,以匹配整个待验证字符串;搜索/替换时是否加上此限定则根据搜索的要求而定,此外,也有可能要在前后加上\b而不是^和$。此表所列的常用正则表达式,除个别外均未在前后加上任何限定,请根据需要,自行处理。
说明     正则表达式
网址(URL)     [a-zA-z]+://[^\s]*
IP地址(IP Address)     ((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)
电子邮件(Email)     \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
QQ号码     [1-9]\d{4,}
HTML标记(包含内容或自闭合)     <(.*)(.*)>.*<\/\1>|<(.*) \/>
密码(由数字/大写字母/小写字母/标点符号组成,四种都必有,8位以上)     (?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$
日期(年-月-日)     (\d{4}|\d{2})-((0?([1-9]))|(1[1|2]))-((0?[1-9])|([12]([1-9]))|(3[0|1]))
日期(月/日/年)     ((0?[1-9]{1})|(1[1|2]))/(0?[1-9]|([12][1-9])|(3[0|1]))/(\d{4}|\d{2})
时间(小时:分钟, 24小时制)     ((1|0?)[0-9]|2[0-3]):([0-5][0-9])
汉字(字符)     [\u4e00-\u9fa5]
中文及全角标点符号(字符)     [\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
中国大陆固定电话号码     (\d{4}-|\d{3}-)?(\d{8}|\d{7})
中国大陆手机号码     1\d{10}
中国大陆邮政编码     [1-9]\d{5}
中国大陆身份证号(15位或18位)     \d{15}(\d\d[0-9xX])?
非负整数(正整数或零)     \d+
正整数     [0-9]*[1-9][0-9]*
负整数     -[0-9]*[1-9][0-9]*
整数     -?\d+
小数     (-?\d+)(\.\d+)?