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
まだ正規表現で消耗してるの? / PHP Conference Fukuoka 2016
Search
Kenichiro Kishida
May 29, 2016
Technology
0
1.2k
まだ正規表現で消耗してるの? / PHP Conference Fukuoka 2016
PHPカンファレンス福岡2016のLTスライドです
Kenichiro Kishida
May 29, 2016
Tweet
Share
More Decks by Kenichiro Kishida
See All by Kenichiro Kishida
Code兄弟での CI/CDをいい感じにする方法 / phpstudy-2024-06
sizuhiko
0
120
Webアクセシビリティワークショップを社内でやってみた / phpconfuk-2024
sizuhiko
1
270
デベロッパーよ 健康でいるためには 寝て 旅をして 趣味を持って メンタル大切に / DE-RADIO-2023-06-26
sizuhiko
0
100
ヘビータブユーザーが ワークスペースの利用でどのように変わったか / 2023-05-16 Vivaldi User Meetup TOKYO 2023
sizuhiko
0
270
Node.js v18 ベースイメージを使った AWS Lambda アプリ開発におけつ光と影 / 2023-04-23 JavaScript Fes
sizuhiko
0
160
@swc-node/jest を使って テストを高速化する/jsfes-2022
sizuhiko
0
310
Rails 7の採用提案で注目を集め始めた Import maps の過去、現在、そして未来について/de radio 2
sizuhiko
2
1.4k
勉強会主体で サービスを作るということ/esm-meetup-3
sizuhiko
0
310
オンライン勉強会や イベントで 盛り上がりを共有したい!/jsfes2021-summer
sizuhiko
0
670
Other Decks in Technology
See All in Technology
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
Qiita埋め込み用スライド
naoki_0531
0
860
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
0
150
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
430
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
Featured
See All Featured
It's Worth the Effort
3n
183
28k
The Invisible Side of Design
smashingmag
298
50k
Faster Mobile Websites
deanohume
305
30k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Facilitating Awesome Meetings
lara
50
6.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Docker and Python
trallard
42
3.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Transcript
· ͩ ਖ਼ ن ද ݱ Ͱ ফ ͠
ͯ Δ ͷ ʁ Մ ಡ ੑ Λ ্ ͛ Δ ͱ ͏ · ͘ ͍ ͘ ͠ ͣ ͻ ͜ 1)1ΧϯϑΝϨϯεԬ ෳࡶͳਖ਼نදݱΛߟ͑Δͷ࣌ؒͷແବͩͬͨ ౦ ژ
,FOJDIJSP,JTIJEB 5PLZP +"1"/ TJ[VIJLP!HNBJMDPN !TJ[VIJLP IUUQTHJUIVCDPNTJ[VIJLP IUUQCMPHPQFOUPLZPKQ R: HmM^JRTIeUY
I — ਖ਼نදݱ
/(?:(?P<dayOfWeek>(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)|(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))? (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)|(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]| [\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n)) (?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+ (?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]| [\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n)) (?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+) +)))?)),)?(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:\d){1,2}(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)|(?:(?: (?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?
(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t]) +(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))? (?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:\d){1,2}(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?: \n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]| [\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?:(?:(?:(?:(?:[\x20\t]) +(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:\d)(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)|(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r \n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]| [\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?: [\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:\d)(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?: [\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]| [\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?: \n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+) (?:(?:\d){2,2}|(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n)) (?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+ (?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+ (?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:\d){2,2}(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?: (?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0| (?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?: [\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))\:(?:(?:\d){2,2}|(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?: [\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93- \d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?: \n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:\d){2,2}(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]| [\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n)) (?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))(?:\:(?:(?:\d){2,2}|(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n)) (?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]| [\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))? \)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?(?:\d){2,2}(?:(?:(?:(?: (?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?: [\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?: (?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?: [\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))))?(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)(?:\+|\-)(?:\d){4,4}|(?:UT|GMT|EST|EDT|CST|CDT|MST| MDT|PST|PDT|[\d65-\d73]|[\d75-\d90]|[\d97-\d105]|[\d107-\d122]))(?:(?:(?:(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?P<comment>\((?:(?:(?:(?:(?:[\x20\t])+(?: (?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?(?:(?:[\d33-\d39]|[\d42-\d91]|[\d93-\d126]|(?:[\d1-\d8]|[\d11]|[\d12]|[\d14-\d31]|[\d127]))|(?:\\(?:[\x21-\x7E]|[\x20\t])|\\(?:\d0|(?:[\d1-\d8]| [\d11]|[\d12]|[\d14-\d31]|[\d127])|\n|\r))|(?P>comment)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?\)))+(?:(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?: [\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+))?|(?:(?:(?:[\x20\t])+(?:(?:\n)|(?:\r\n)))?(?:[\x20\t])+|(?:[\x20\t])+(?:(?:(?:\n)|(?:\r\n))(?:[\x20\t])+)+)))?$/
None
RFC5322 Internet Message Format Date and Time Specification
/^(?P<scheme>[a-zA-Z](?:[a-zA-Z0-9\+\-\.])*)\:(?P<hierPart>(?:\/\/(? P<authority>(?:(?P<userinfo>(?:(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]){2}| [\!\$&'\(\)\*\+,;\=]|\:))*)@)?(?P<host>(?:(?:0-9|1-90-9|10-90-9|20-40-9| 250-5)\.(?:0-9|1-90-9|10-90-9|20-40-9|250-5)\.(?:0-9|1-90-9|10-90-9| 20-40-9|250-5)\.(?:0-9|1-90-9|10-90-9|20-40-9|250-5)|(?:(?:[a-zA- Z0-9\-\._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\+,;\=]))+))(?:\:(?P<port>(?:\d) +))?)(?P<pathAbempty>(?:\/(?:(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]){2}|[\! \$&'\(\)\*\+,;\=]|\:|@))*)*)|(?P<pathAbsolute>\/(?:(?:(?:[a-zA-Z0-9\- \._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\+,;\=]|\:|@))+(?:\/(?:(?:[a-zA-Z0-9\- \._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\+,;\=]|\:|@))*)+)?)|(?
P<pathRootless>(?:(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\ +,;\=]|\:|@))+(?:\/(?:(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\ +,;\=]|\:|@))*)*)|(?P<pathEmpty>^(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]) {2}|[\!\$&'\(\)\*\+,;\=]|\:|@))))(?:\?(?P<query>(?:(?:(?:[a-zA-Z0-9\-\._~]| %(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\+,;\=]|\:|@)|\/|\?))*))?(?:#(?P<fragment>(?: (?:(?:[a-zA-Z0-9\-\._~]|%(?:[0-9A-Z]){2}|[\!\$&'\(\)\*\+,;\=]|\:|@)|\/| \?))*))?$/
RFC3986 Uniform Resource Identifier (URI): Generic Syntax
URI = scheme ":" hier-part [ "?" query ] [
"#" fragment ] scheme = ALPHA * ( ALPHA / DIGIT / "+" / "-" / "." ) hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty https://www.ietf.org/rfc/rfc3986.txt
wݕࡧͨ݁͠Ռɺग़͖ͯͨਖ਼نදݱΛί ϐϖͯ͠·ͤΜ͔ʁͦΕਖ਼͍͠Ͱ͔͢ʁ wଞͷਓ͕ॻ͍ͨਖ਼نදݱΛؚΉίʔυ ΛϨϏϡʔͰ͖·͔͢ʁ wޙͰͦͷਖ਼نදݱϝϯςͰ͖·͔͢ʁ
ͬͱ؆୯ʹ ॻ͖͍ͨPSಡΈ͍ͨ ͱࢥͬͨ͜ͱͳ͍Ͱ͔͢ʁ
None
Regular Expressions made easy
$regex = new VerbalExpressions; $regex->startOfLine() ->then("http") ->maybe("s") ->then("://") ->maybe("www.") ->anythingBut("
") ->endOfLine(); /^(?:http)(?:s)?(?:\:\/\/)(?:www\.)?(?:[^ ]*)$/m
$rfc3986 = new VerbalExpressions; // scheme $scheme = new VerbalExpressions;
$scheme->add("http")->maybe("s") ->_or("ftp"); $rfc3986->startOfLine() ->add($scheme) ->add("://"); /^(?:\(\?\:http\)\(\?\:s\)\?\)\|\(\?\:ftp)(?:\:\/\/)/m
w⾭ଟ͘ͷݴޠʹରԠ͍ͯ͠Δ w⾭؆୯ʹॻ͚Δ w⾪ෳࡶͳέʔεॻ͚ͳ͍ w⾪ݴޠʹΑ࣮͕ͬͯϚνϚν
None
None
None
http://www.kurtisrainboltgreene.name/hexpress/
The hexpress gem is another take at the concept of
"Verbal Hexpressions" in Ruby.
pattern = Hexpress.new. start("http"). maybe("s"). with("://"). maybe { words.with(".") }.
find { matching { [word, "-"] }.multiple }. has("."). either("com", "org"). maybe("/"). ending
ϫλγϋϧϏʔνϣοτ
To PHP https://github.com/sizuhiko/hexpress
trait Find { public function find($value = null, $named =
false) { $param = compact('value', 'named'); return is_callable($value) ? $this->addNested(FindValue::class, $param) : $this->addValue(FindValue::class, $param); } public function capture($value = null) { return $this->find($value); } } class FindValue { use Nested; private $hexpression; private $open; private $close; public function __construct($param) { extract($param); $this->hexpression = is_callable($value) ? new Hexpress($value) : $value; $this->open = $named ? "(?P<{$named}>" : '('; $this->close = ')'; } } class Hexpress def find(value = nil, &block) value ? add_value(Nested::Find, value) : add_nested(Nested::Find, &block) end alias_method :capture, :find module Nested class Find include Nested def initialize(value=nil,&block) @hexpression = value || Hexpress.new.instance_eval(&block) @open, @close = "(", ")" end end end end ࠷ۙͷ1)1ͳΒ͔ͳΓ࣮ʹҠ২Մೳ
URI = scheme ":" hier-part [ "?" query ] [
"#" fragment ] scheme = ALPHA * ( ALPHA / DIGIT / "+" / "-" / "." ) hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty https://www.ietf.org/rfc/rfc3986.txt
$this->hexpress ->start($this->scheme()) ->with(':') ->has($this->hierPart()) ->maybe($this->query()) ->maybe($this->fragment()) ->end(); URI = scheme
":" hier-part [ "?" query ] [ "#" fragment ]
private function scheme() { return (new Hexpress()) ->find(function ($hex) {
$hex->matching(function ($hex) { $hex->letter(); }); $hex->many(function ($hex) { $hex->matching(function ($hex) { $hex->letter()->number()->with('+-.'); }); }, 0); }, 'scheme'); } scheme = ALPHA * ( ALPHA / DIGIT / "+" / "-" / "." ) ̍ ̍
1)1൛ͷಠࣗػೳ ໊લ͖αϒύλʔϯ
private function scheme() { return (new Hexpress()) ->find(function ($hex) {
$hex->matching(function ($hex) { $hex->letter(); }); $hex->many(function ($hex) { $hex->matching(function ($hex) { $hex->letter()->number()->with('+-.'); }); }, 0); }, 'scheme'); } scheme = ALPHA * ( ALPHA / DIGIT / "+" / "-" / "." ) pOEϝιουͷୈೋҾʹ αϒύλʔϯͷ໊લΛࢦఆͰ͖Δ
preg_match( 'http://example.com:80/', $pattern->toRegExp(), $matches); echo $matches['scheme']; #=> 'http'
w͏ਖ਼نදݱͳΜ͔Ͱফ͠ͳ͍ʂ w3VCZͷΤίγεςϜ͔ΒͷҠ২༰қ ʹͳ͍ͬͯΔʂʂ wఘΊͳ͍Ͱʂʂʂ
WJTJUNZCMPHHJUIVC https://github.com/sizuhiko http://blog.open.tokyo.jp R: HmM^JRTIeUY @sizuhiko #phpstudy 2016/3/30