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
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Rubyの配布パッケージの変遷
znz
0
35
Headscale + Tailscale に移行中
znz
0
75
Ruby on Rails と私
znz
0
83
riscv64.rubyci.org internal
znz
0
62
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
120
devise-two-factorを4.xから5.xに上げた話
znz
0
430
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
120
Ubuntuのriscv64版をqemuで動かした
znz
0
150
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
150
Other Decks in Programming
See All in Programming
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
0
110
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
750
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
280
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
330
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.7k
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.4k
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.2k
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
180
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
190
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.2k
AIエージェントで 変わるAndroid開発環境
takahirom
2
740
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
620
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.7k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
340
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
220
We Are The Robots
honzajavorek
0
290
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Deep Space Network (abreviated)
tonyrice
0
240
Technical Leadership for Architectural Decision Making
baasie
3
450
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
780
The Cost Of JavaScript in 2023
addyosmani
55
10k
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