Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
正規表現の \z の話
Search
Kazuhiro NISHIYAMA
June 13, 2015
Programming
180
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
Reforming the Japanese Ruby reference manual
znz
0
36
Rubyの配布パッケージの変遷
znz
0
57
Headscale + Tailscale に移行中
znz
0
110
Ruby on Rails と私
znz
0
97
riscv64.rubyci.org internal
znz
0
69
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
130
devise-two-factorを4.xから5.xに上げた話
znz
0
470
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
130
Ubuntuのriscv64版をqemuで動かした
znz
0
170
Other Decks in Programming
See All in Programming
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
golang-bob.pdf
iwatsukayura
0
130
APNsからLive Activityを開始する話
yumnumm
0
170
Next.js: The final boss of Web Performance
guaca
0
280
Domain-Driven Transformation
hschwentner
2
2.3k
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.9k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
220
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
980
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Tell your own story through comics
letsgokoyo
1
1.1k
A Tale of Four Properties
chriscoyier
163
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
420
How to train your dragon (web standard)
notwaldorf
96
6.9k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Ethics towards AI in product and experience design
skipperchong
2
440
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