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
Perl 6 Regex
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
lichtkind
September 05, 2015
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Perl 6 Regex
features and syntax of the new reformed Perl Regular Expression
lichtkind
September 05, 2015
More Decks by lichtkind
See All by lichtkind
Perl 6 in context
lichtkind
0
73
Perl 6 OOP
lichtkind
0
230
Perl 6 data structures
lichtkind
0
160
functional Perl 6
lichtkind
0
840
Other Decks in Programming
See All in Programming
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
220
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
130
Vite+ Unified Toolchain for the Web
naokihaba
0
330
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
370
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
180
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
170
HDC tutorial
michielstock
2
720
How to Talk to Developers About Accessibility
jct
2
240
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
A Tale of Four Properties
chriscoyier
163
24k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Building Adaptive Systems
keathley
44
3.1k
Are puppies a ranking factor?
jonoalderson
1
3.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
66
55k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Facilitating Awesome Meetings
lara
57
7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Transcript
Perl 6 regex
Perl 6 regex In search for perfection
Much is Gone
Something Stayed ops: m//, s/// , tr/// mods: i, g
capturing: (…) escape: \ quantifier: *, +, ? min. match. suffix: ??, *?, +? alternatives: | match var.: $1 .. $9
Operators
Create A Regex rx/.../
It's The New qr// rx/.../
Apply Rx ~~
Known Since 5.10 ~~
Still Changing In 5.18 ~~
Apply Rx ~~ no more =~
Known Operators m// s///
Rx Methods match comb subst
New Operators ms// ss///
Aliases For: m :s// s :ss///
Modifiers
Modifiers no x
Modifiers no x m s
Modifiers no s e x
Modifiers no s ee x
Modifiers P5 Perl5
Modifiers :P5 :Perl5
Modifiers ~~ m :P5 /.../
Match All :g :global
Match n Times :x(n)
Just nth Match :nth(n)
Search from Pos On :c(n) :continue(n)
Search Only On Pos :p(n) :pos(n)
Spaces Have Meaning :s :sigspace :ss :samespace
Like qw// Only Smarter :s :sigspace :ss :samespace
Lower Line Is For s/// :s :sigspace :ss :samespace
Modifiers :i :ignorecase :ii :samecase
Modifiers :m :ignoremark :mm :samemark
Choose A Level :bytes :chars :codes :graphs
Metachar
Metachar .
Metachar . any char
Metachar .
Metachar .
No Output In Perl 5 perl -e 'print 1 if
"\n"=~ /./
Do Output In Perl 6 perl6 -e 'say 1 if
"\n"~~ /./
Metachar . any char
Metachar \N not a newline
Metachar ^ $ You know that
Metachar ^^ $$ linewise
'a' Wins In Perl 5 perl -E '"ab"=~ /(a|ab)/;say $1'
'ab' Wins In Perl 6 perl6 -E '"ab"~~/(a|ab)/;say $0'
Metachar | longest wins
Metachar || first wins
Metachar () capt. groups
Metachar [ ] nonecapturing groups
Metachar <[ ]> char classes
Metachar \s space
Metachar \s = \h | \v horizont. or vertic.
Metachar \s = \h | \v \r \n and alike
Metachar \s = \h | \v Spaces, tabs(\t) and alike
Quantifiers
Quantifiers simple have not changed
Five Digits \d ** 5
Five Digits \d ** 5 '12345'
Two to Five Digits \d ** 2..5
Colon Seperated Digits \d+ % ','
Colon Seperated Digits \d+ % ',' '1,2,3,4'
+ Trailing Seperator \d+ %% ',' '1,2,3,4,'
Combined \d ** 2..* % ','
Special Var
Match Object $/ last sucessful Match
Named Submatch $/ $/<...>
Named Submatch $/ $/{'...'} $<...>
List Of Matches @()
List Of Matches @() @() = $0 ..
List Of Matches @()[n] @() = $0 .. (no limit)
AoA Of Matches @()[1][2] .(.).(.(.).(.).(...).).
Learn More http://perlcabal.org /syn/S05.html
Thank You