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
100
正規表現の \z の話
あるちょっと遅そうな正規表現を高速化した話
Kazuhiro NISHIYAMA
June 13, 2015
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
20
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
16
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
76
Rubyist Magazine Reboot
znz
0
81
History of Japanese Ruby reference manual, and future
znz
0
1.4k
qemuのriscv64にDebianを入れてみた
znz
0
88
systemd 再入門
znz
0
270
Ruby 3.0.0 コネタ集
znz
0
250
livedoor天気API終了対応
znz
0
240
Other Decks in Programming
See All in Programming
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4.1k
Java 22 Overview
kishida
1
180
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
240
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Ruby Pattern Matching
bkuhlmann
0
930
SIMD Parallel Programming with the Vector API
josepaumard
0
160
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
370
雑に思考を整理する技術と効能
konifar
59
29k
Netty Chicago Java User Group 2024-04-17
sullis
0
170
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
0
110
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
920
Featured
See All Featured
Making Projects Easy
brettharned
108
5.5k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Become a Pro
speakerdeck
PRO
11
4.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
How STYLIGHT went responsive
nonsquared
92
4.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Designing for Performance
lara
601
67k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Testing 201, or: Great Expectations
jmmastey
28
6.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
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