You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are some phone numbers 915-134-3122. Also,
you can call me at 643.123.1333 and of course,
I'm always reachable at (212)867-5509
\(?\d{3}[-.)]\d{3}[-.]\d{4}
写在前面
每次用正则都是现查,想把正则弄好真的好长时间了。今天又刷到了正则表达式的文章,准备记录一下,方便日后复习。
之前收藏过的正则表达式的文章如下
笔记
元字符
[ ] ( ) { } . * + ? ^ $ \ |
简写字符集
[a-zA-Z0-9_]
[^\w]
[0-9]
[^\d]
[\t\n\f\r\p{Z}]
[^\s]
\r\n
),用来匹配 DOS 行终止符横向模糊匹配与纵向模糊匹配
横向(/g代表全文搜索):
纵向
\w+ 这个应该毫无疑问,匹配所有的words
匹配下面电话号码
比如[-.]的含义是连字符-或者点符.。 但是,如果当连字符不是第一个字符时,比如[a-z],这就表示是从字母a到字符z。
^在之前介绍中,是表示一行开头,但是在[]中,有着不同的含义。 [ab] 表示a或者b [^ab] 啥都行,只要不是a或b(anythings except a and b),相当于取反
The text was updated successfully, but these errors were encountered: