Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
regular expressions
Search
多火工作室
May 09, 2015
Education
0
59
regular expressions
多火工作室#技术群殴#
多火工作室
May 09, 2015
Tweet
Share
More Decks by 多火工作室
See All by 多火工作室
github&git
luxiaojijan
1
140
Nodejs实现RESTful api
luxiaojijan
1
120
机器人餐厅
luxiaojijan
0
74
做全栈的java开发者
luxiaojijan
0
82
python的介绍与web实战
luxiaojijan
0
110
Other Decks in Education
See All in Education
Monaca Educationを活用したプログラミング授業実践
asial_edu
0
200
スクフェスの学びにチームを惹き込め! 社内同時視聴会のすゝめ!
pokotyamu
0
690
TCA Practice in 5 min
d_date
1
560
ISMSってどんなもの?
fbei_ot
0
160
アプリ開発を目指した授業づくりについて
asial_corp
0
420
Canva
matleenalaakso
0
150
D&I推進レポート〜テクノロジー分野のジェンダーギャップとその取り組みについて〜
codeforeveryone
1
800
Frederick Douglass versus George Fitzhugh
oripsolob
0
600
Data Processing and Visualisation Frameworks - Lecture 6 - Information Visualisation (4019538FNR)
signer
PRO
1
1.7k
わたしのメタ学習 / My Own Meta Learning #shinjukurb
expajp
0
110
UniKL 2024 - Phishing Security Awareness: Malware
x86fatah
0
110
【滋賀大学データサイエンス学部】PropTech(不動産テック)における AI・データサイエンス活用
takehikohashimoto
0
4.1k
Featured
See All Featured
Gamification - CAS2011
davidbonilla
76
4.6k
Web development in the modern age
philhawksworth
202
10k
Design by the Numbers
sachag
274
18k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
4 Signs Your Business is Dying
shpigford
175
21k
The Cost Of JavaScript in 2023
addyosmani
14
3.8k
How GitHub (no longer) Works
holman
304
140k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Into the Great Unknown - MozCon
thekraken
10
980
Building Your Own Lightsaber
phodgson
98
5.7k
The Mythical Team-Month
searls
215
42k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
321
20k
Transcript
<=?]
/^Hello [Ww]orld.?$/
Regular Expressions ᆞ ᄵ і ղ ൔ
ु༯đᆃ൞હ݆Ĥ
ୄઑđݺگᄖđྀ࢚ϔĆ
/pattern/
None
None
字符串的匹配,查找,替换
POSIX & Unix & Programme Unix tools(vim/vi ) Used by
all programming languages(Perl)
<=?]
// (the construct)
?(zero or one) +(one or more) *(zero or more) {n,m}(only
match n to m)
a* a+ a? a{1,3}
^ (匹配开始) $ (结束匹配) \b (开始或者结束)
[.+*] (匹配.或者+或者*) [^.+*] (匹配除了.+*之外的字符)
\d = [0-9] \w = [A-Za-z0-9] \s = [\t\r\n] —表⽰示范围
(匹配除了换⾏行符之外,任⼀一个字符) a(匹配除⼀一个点符号) 转义
/^Hello [Ww]orld.?$/ 开始符号 精确匹配Hello 匹配W或者w 结束 可能出现0次或者1次
/^Hello [Ww]orld.?$/ Hello World Hello world Hello World!
(http://)?w{3}\.[a-z]+\.com www.google.com http://duohuo.org www.zcool.com.cn
/[0-9]{5}(-[0-9]{4})?/ 12345 12345-6789 123-6789
/[0-9]+(-[0-9]{4})?/ 12345 12345-6789 123-6789
() group
反向引用(Backreferences) 小括号里面的正则捕获内容,会进行分组,每个分组会有一个组号, 第一个出现组号为1,第二个出现组号为2。
/(.o)\1r/ dolor
/\b(?:\d{1,3}\.){3}\d{1,3}\b/ 999.999.999.999