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
正規表現の \z の話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kazuhiro NISHIYAMA
June 13, 2015
Programming
0
150
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Ruby on Rails と私
znz
0
44
riscv64.rubyci.org internal
znz
0
41
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
79
devise-two-factorを4.xから5.xに上げた話
znz
0
370
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
92
Ubuntuのriscv64版をqemuで動かした
znz
0
110
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
120
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
110
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
170
Other Decks in Programming
See All in Programming
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
160
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
520
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2k
Graviton と Nitro と私
maroon1st
0
170
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
500
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
130
CSC307 Lecture 07
javiergs
PRO
0
520
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
SourceGeneratorのススメ
htkym
0
160
AtCoder Conference 2025
shindannin
0
1k
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
95
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
69
Paper Plane (Part 1)
katiecoart
PRO
0
3.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
180
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
180
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
30 Presentation Tips
portentint
PRO
1
190
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
300
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