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
正規表現
Search
Yumeto Inaoka
March 01, 2017
Technology
0
220
正規表現
2017/03/01のB3ゼミで発表
Yumeto Inaoka
March 01, 2017
Tweet
Share
More Decks by Yumeto Inaoka
See All by Yumeto Inaoka
文献紹介: Quantity doesn’t buy quality syntax with neural language models
yumeto
1
140
文献紹介: Open Domain Web Keyphrase Extraction Beyond Language Modeling
yumeto
0
180
文献紹介: Self-Supervised_Neural_Machine_Translation
yumeto
0
130
文献紹介: Comparing and Developing Tools to Measure the Readability of Domain-Specific Texts
yumeto
0
130
文献紹介: PAWS: Paraphrase Adversaries from Word Scrambling
yumeto
0
110
文献紹介: Beyond BLEU: Training Neural Machine Translation with Semantic Similarity
yumeto
0
230
文献紹介: EditNTS: An Neural Programmer-Interpreter Model for Sentence Simplification through Explicit Editing
yumeto
0
290
文献紹介: Decomposable Neural Paraphrase Generation
yumeto
0
190
文献紹介: Analyzing the Limitations of Cross-lingual Word Embedding Mappings
yumeto
0
190
Other Decks in Technology
See All in Technology
ZOZOTOWN の推薦における KPI モニタリング/KPI monitoring for ZOZOTOWN recommendations
rayuron
1
900
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
1
5k
20241220_S3 tablesの使い方を検証してみた
handy
4
870
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
33k
Fearsome File Formats
ange
0
550
「完全に理解したTalk」完全に理解した
segavvy
1
270
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
250
React Routerで実現する型安全なSPAルーティング
sansantech
PRO
4
890
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
2.5k
最近のSfM手法まとめ - COLMAP / GLOMAPを中心に -
kwchrk
8
1.8k
TypeScript開発にモジュラーモノリスを持ち込む
sansantech
PRO
3
870
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
170
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Being A Developer After 40
akosma
89
590k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
BBQ
matthewcrist
85
9.4k
Site-Speed That Sticks
csswizardry
2
220
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Statistics for Hackers
jakevdp
797
220k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Cult of Friendly URLs
andyhume
78
6.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
171
50k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Music & Morning Musume
bryan
46
6.3k
Transcript
ਖ਼نදݱ #θϛ ࣗવݴޠॲཧݚڀࣨɹҴԬເਓ
ൃද༰ ˗ ਖ਼نදݱͱ ˗ ਖ਼نදݱΛΘͳ͍߹ɾͬͨ߹ ˗ ߏจ ˗ লུɾϝλจࣈ
ਖ਼نදݱͱ ˗ จࣈྻू߹ΛͭͷจࣈྻͰදݱ͢Δํ๏ ˗ ݕࡧͳͲʹར༻͞Ε͍ͯΔ ˗ ଟ͘ͷϓϩάϥϜݴޠͰར༻Մೳ ˗ ݩʑਓݴޠΛද͢खஈͷͭͱͯ͠ಋೖ ˗
ӳޠͩͱ3FHVMBSFYQSFTTJPO ˗ ུͯ͠SF SFHFY SFHFYQ
ਖ਼نදݱΛΘͳ͍߹ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = ["Windows 95", "Windows95", "windows 95",
“windows95”, "Windows 98", "Windows98", "windows 98", “windows98”] print("ok" if s in os else “ng") # Windows95 -> ok # windows 98 -> ok # Windows Me -> ng
ਖ਼نදݱΛͬͨ߹ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = r"[Ww]indows ?9[58]" print("ok" if
re.match(os, s) else “ng") # Windows95 -> ok # windows 98 -> ok # Windows Me -> ng
ਖ਼نදݱΛͬͨ߹ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}" print("ok" if re.match(phone,
s) else "ng") # 070-0123-4567 -> ok # 09009876543 -> ok # 06-6012-3456 -> ng
ਖ਼نදݱͷߏจ ˗ ҙͷҰจࣈ ptn = r”r.c.” # rice ->
ok # rich -> ok # rock -> ok # roc -> ng # reach -> ng
ਖ਼نදݱͷߏจ ˗ ಛఆͷҰจࣈ<ʜ> ptn = r”[bdm]ay” # bay ->
ok # day -> ok # may -> ok # way -> ng # say -> ng # pay -> ng
ਖ਼نදݱͷߏจ ˗ จ಄? ptn = r”^re” # reborn ->
ok # revenge -> ok # replay -> ok # preview -> ng # unstable -> ng # alive -> ng
ਖ਼نදݱͷߏจ ˗ จ ptn = r”able$” # movable ->
ok # readable -> ok # able -> ok # stably -> ng # assemble -> ng
ਖ਼نදݱͷߏจ ˗ ճҎ্ͷ܁Γฦ͠ ptn = r”w*” # w
-> ok # ww -> ok # wwww -> ok # -> ok # oh -> ng # yeah -> ng # hey -> ng
ਖ਼نදݱͷߏจ ˗ ճҎ্ͷ܁Γฦ͠ ptn = r”oh+” # oh
-> ok # ohh -> ok # ohhhh -> ok # o -> ng # ok -> ng
ਖ਼نදݱͷߏจ ˗ ճ͔ճ ptn = r”^b?l?ack” # ack
-> ok # lack -> ok # back -> ok # black -> ok # block -> ng # slack -> ng
ਖ਼نදݱͷߏจ ˗ Nճ͔ΒOճ\N O^ ptn = r”^g{2,4}d$” # good
-> ok # goood -> ok # gooood -> ok # gd -> ng # god -> ng # goooood -> ng
লུɾϝλจࣈ ˗ ܻҎ্ͷࣈྻ ptn = r”[0123456789]+”
লུɾϝλจࣈ ˗ ܻҎ্ͷࣈྻ # ptn = r”[0123456789]+” ptn = r”[0-9]+”
লུɾϝλจࣈ ˗ ܻҎ্ͷࣈྻ # ptn = r”[0123456789]+” # ptn =
r”[0-9]+” ptn = r”\d+”
লུɾϝλจࣈ ˗ จࣈҎ্ͷӳখจࣈྻ ptn = r”[abcdefghijklmnopqrstuvwxyz]+”
লུɾϝλจࣈ ˗ จࣈҎ্ͷӳখจࣈྻ # ptn = r”[abcdefghijklmnopqrstuvwxyz]+” ptn = r”[a-z]+”
লུɾϝλจࣈ ˗ ઌ಄͕ӳࣈɺͦΕҎ͕߱ӳࣈຢ@ ptn = r”[a-zA-Z][a-zA-Z_\d]*”
লུɾϝλจࣈ ˗ ઌ಄͕ӳࣈɺͦΕҎ͕߱ӳࣈຢ@ # ptn = r”[a-zA-Z][a-zA-Z_\d]*” ptn = r”[a-zA-Z]\w*”
ਖ਼نදݱͷྫ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = r"[Ww]indows ?9[58]"
ਖ਼نදݱͷྫ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = r"[Ww]indows ?9[58]"
ਖ਼نදݱͷྫ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = r"[Ww]indows ?9[58]"
ਖ਼نදݱͷྫ ˗ 8JOEPXT8JOEPXTΛݕࡧ os = r"[Ww]indows ?9[58]"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ਖ਼نදݱͷྫ ˗ ܞଳి൪߸Λݕࡧ phone = r"0[789]0-?\d{4}-?\d{4}"
ൃදͨ͠༰ ˗ ਖ਼نදݱͱ ˗ ਖ਼نදݱΛΘͳ͍߹ɾͬͨ߹ ˗ ߏจ ˗ লུɾϝλจࣈ