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
39
riscv64.rubyci.org internal
znz
0
39
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
76
devise-two-factorを4.xから5.xに上げた話
znz
0
370
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
91
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
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
36k
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
690
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.5k
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
1
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
130
Graviton と Nitro と私
maroon1st
0
150
Go コードベースの構成と AI コンテキスト定義
andpad
0
150
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
970
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
490
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
150
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
400
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
54
48k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
41
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
140
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
120
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Amusing Abliteration
ianozsvald
0
79
Building Applications with DynamoDB
mza
96
6.9k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
1
330
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
Code Review Best Practice
trishagee
74
19k
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