Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
正規表現の \z の話
Search
Kazuhiro NISHIYAMA
June 13, 2015
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Reforming the Japanese Ruby reference manual
znz
0
36
Rubyの配布パッケージの変遷
znz
0
57
Headscale + Tailscale に移行中
znz
0
110
Ruby on Rails と私
znz
0
97
riscv64.rubyci.org internal
znz
0
69
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
130
devise-two-factorを4.xから5.xに上げた話
znz
0
470
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
130
Ubuntuのriscv64版をqemuで動かした
znz
0
170
Other Decks in Programming
See All in Programming
JIS keyboard support in Omarchy
lef237
0
130
残高管理から台帳サービスへの進化
artoy
1
200
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
440
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
800
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
800
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Raft: Consensus for Rubyists
vanstee
142
7.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Optimizing for Happiness
mojombo
378
71k
Ethics towards AI in product and experience design
skipperchong
2
440
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Automating Front-end Workflow
addyosmani
1369
210k
Become a Pro
speakerdeck
PRO
31
6.3k
Transcript
正規表現の� � \z� の話 あるちょっと遅そうな正規表現を� � ⾼速化した話 Kazuhiro� NISHIYAMA 第67回�
Ruby関⻄� 勉強会 2015/06/13
自⼰紹介 twitter� や� github� では� @znz
Ruby� 関連 Ruby� (CRuby)� のコミッター Ruby� 関係でいろいろ るびま� (Rubyist� Magazine)�
とか http://magazine.rubyist.net/ るりま� (Ruby� リファレンスマニュア ル)� とか http://docs.ruby-lang.org/ja/ Ruby� 関連のイベントでの発表
とある正規表現 �������� 遅そう ⽂字列末尾以外にもマッチする
⽂字クラスを使う ������� 速くなった(ベンチマークは後で)
\z� を使う �������� �:� ⾏末にマッチ ��:� ⽂字列末尾のみにマッチ もっと速くなった
ベンチマーク ������������������� ��������������� ������������������� ��������������������� �������� ��������������������� ������������������������������������������������������ ������������������������������������������������������ ������������������������������������������������������
������������������������������������������������������ ���
ベンチマーク結果� (1) ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������ �������������������������������������������������������
������������������������������������������������������� ������������������������������������������������������� �������������������������������������������������������
ベンチマーク結果� (2) ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������� ������������������������������������������������������ �������������������������������������������������������
������������������������������������������������������� ������������������������������������������������������� �������������������������������������������������������
まとめ 1⽂字の場合は選択� (ん|ン)� では なく⽂字クラス� [んン]� を使おう ⽂字列末尾は� $� ではなく�
\z