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
Kazuhiro NISHIYAMA
June 13, 2015
Programming
0
130
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
7
devise-two-factorを4.xから5.xに上げた話
znz
0
32
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
34
Ubuntuのriscv64版をqemuで動かした
znz
0
36
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
43
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
30
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
98
Rubyist Magazine Reboot
znz
0
120
History of Japanese Ruby reference manual, and future
znz
0
1.5k
Other Decks in Programming
See All in Programming
メルカリ ハロ アプリの技術スタック
atsumo
2
910
急速に利用拡大を続ける飲食店向けサービスで 店内端末同士のローカル通信を追加設定なしで実現した話
whatasoda
0
150
Re:proS_案内資料
rect
0
210
レイトレ合宿10 レンダラー紹介 / Renderer Introduction, Ray Tracing Camp 10
shocker_0x15
0
640
cgroup v2 support in Kubeadm
kentatada
0
220
.NET Aspireのクラウド対応検証: Azureと他環境での実践
ymd65536
1
670
CSC509 Lecture 06
javiergs
PRO
0
140
組織に自動テストを書く文化を根付かせる戦略(2024秋版) / Building Automated Test Culture 2024 Autumn Edition
twada
PRO
9
3.9k
CSC509 Lecture 07
javiergs
PRO
0
140
Програмиране с Rust, ФМИ, 2024
nikolads
0
130
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
290
Mercari AI/LLM Hackathon TeamBの発表資料
imaikosuke
0
190
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
692
190k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
130k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
GitHub's CSS Performance
jonrohan
1030
460k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.7k
Bash Introduction
62gerente
608
210k
Music & Morning Musume
bryan
46
6.1k
A Philosophy of Restraint
colly
203
16k
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