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
Perl 6 Regex
Search
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
76
Perl 6 OOP
lichtkind
0
240
Perl 6 data structures
lichtkind
0
160
functional Perl 6
lichtkind
0
840
Other Decks in Programming
See All in Programming
Building an Out-of-Order CPU
latte72
1
790
Jetpack Compose メカニズム
skydoves
0
460
Agents on Rails - Rails at Scale 2026
irinanazarova
0
140
SREの越境 / SRE Collaboration
y0hgi
2
260
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.9k
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
530
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.2k
新卒PdEのリアル
ryu1013
1
510
Java 27新機能 / Java 27 new features
kishida
2
150
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
140
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.2k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
The SEO identity crisis: Don't let AI make you average
varn
0
560
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
400
How to Ace a Technical Interview
jacobian
281
24k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
GitHub's CSS Performance
jonrohan
1033
470k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
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