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
140
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Ruby on Rails と私
znz
0
10
riscv64.rubyci.org internal
znz
0
7
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
52
devise-two-factorを4.xから5.xに上げた話
znz
0
220
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
72
Ubuntuのriscv64版をqemuで動かした
znz
0
89
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
92
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
80
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
140
Other Decks in Programming
See All in Programming
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
240
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
4
260
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
590
エンジニア向け採用ピッチ資料
inusan
0
180
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
290
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
6
5.1k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
2
260
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
Team operations that are not burdened by SRE
kazatohiei
1
290
Featured
See All Featured
Practical Orchestrator
shlominoach
188
11k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Documentation Writing (for coders)
carmenintech
72
4.9k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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