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
80
regular expressions
多火工作室#技术群殴#
多火工作室
May 09, 2015
Tweet
Share
More Decks by 多火工作室
See All by 多火工作室
github&git
luxiaojijan
1
260
Nodejs实现RESTful api
luxiaojijan
1
150
机器人餐厅
luxiaojijan
0
110
做全栈的java开发者
luxiaojijan
0
120
python的介绍与web实战
luxiaojijan
0
110
Other Decks in Education
See All in Education
1216
cbtlibrary
0
160
小学校5,6年生向けキャリア教育 大人になるまでの道
sat
PRO
8
3.4k
この講義について / 00-setup
kaityo256
PRO
0
220
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
【ZEPメタバース校舎操作ガイド】
ainischool
0
120
GitHubによるWebアプリケーションのデプロイ / 07-github-deploy
kaityo256
PRO
1
180
多様なメンター、多様な基準
yasulab
6
19k
Introduction - Lecture 1 - Information Visualisation (4019538FNR)
signer
PRO
0
5.3k
高校数学B「統計的な推測」 分野の問題と課題
shimizudan
1
110
HCI Research Methods - Lecture 7 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.4k
2026 Medicare 101 Presentation
robinlee
PRO
0
190
栃木にいても「だいじ」だっぺ〜! 栃木&全国アジャイルコミュニティへの参加・運営の魅力
sasakendayo
1
180
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
260
The agentic SEO stack - context over prompts
schlessera
0
690
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The Invisible Side of Design
smashingmag
302
51k
RailsConf 2023
tenderlove
30
1.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
How to build a perfect <img>
jonoalderson
1
5.3k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
150
Raft: Consensus for Rubyists
vanstee
141
7.4k
Mobile First: as difficult as doing things right
swwweet
225
10k
Tell your own story through comics
letsgokoyo
1
840
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