$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
正規表現の \z の話
Search
Kazuhiro NISHIYAMA
June 13, 2015
Programming
0
140
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Ruby on Rails と私
znz
0
37
riscv64.rubyci.org internal
znz
0
36
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
73
devise-two-factorを4.xから5.xに上げた話
znz
0
360
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
89
Ubuntuのriscv64版をqemuで動かした
znz
0
110
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
110
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
110
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
160
Other Decks in Programming
See All in Programming
マスタデータ問題、マイクロサービスでどう解くか
kts
0
120
tparseでgo testの出力を見やすくする
utgwkk
2
280
チームをチームにするEM
hitode909
0
370
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
890
AIコーディングエージェント(skywork)
kondai24
0
200
SwiftUIで本格音ゲー実装してみた
hypebeans
0
490
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
320
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
960
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
160
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
260
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.3k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
0
94
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
17
Agile that works and the tools we love
rasmusluckow
331
21k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
69
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Believing is Seeing
oripsolob
0
15
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Code Review Best Practice
trishagee
74
19k
Producing Creativity
orderedlist
PRO
348
40k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
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