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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Headscale + Tailscale に移行中
znz
0
36
Ruby on Rails と私
znz
0
57
riscv64.rubyci.org internal
znz
0
47
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
95
devise-two-factorを4.xから5.xに上げた話
znz
0
390
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
100
Ubuntuのriscv64版をqemuで動かした
znz
0
120
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
120
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
120
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.4k
Rethinking API Platform Filters
vinceamstoutz
0
910
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
820
Windows on Ryzen and I
seosoft
0
400
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
110
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.4k
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
OTP を自動で入力する裏技
megabitsenmzq
0
130
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
4
2k
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
330
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
290
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
220
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
280
The Spectacular Lies of Maps
axbom
PRO
1
650
A Tale of Four Properties
chriscoyier
163
24k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
The agentic SEO stack - context over prompts
schlessera
0
720
Embracing the Ebb and Flow
colly
88
5k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
490
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