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
Expressões Regulares
Search
Vitor Mendrone
January 23, 2020
Technology
52
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Expressões Regulares
O mínimo que você precisa saber sobre expressões regulares para parecer um gênio.
Vitor Mendrone
January 23, 2020
More Decks by Vitor Mendrone
See All by Vitor Mendrone
Como se tornar indispensável em um mercado em crise?
mendrone
0
86
A arte da composição
mendrone
0
44
Como escolher uma stack para meu projeto?
mendrone
0
34
Future Proof CSS - 2019
mendrone
0
82
Vue.js - O Antes, o Durante e o Depois
mendrone
0
130
Future Proof CSS
mendrone
1
130
High Speed Workflow
mendrone
4
150
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
95
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
82
Other Decks in Technology
See All in Technology
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
100
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
890
1週間、Opus封印でお願いします
kintotechdev
0
400
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
580
Draft AIエージェントの トークン消費を最小化する 8つの原則
kinopeee
6
1.9k
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
130
正解のない研修に放り出されて / Being thrown into a training program with no right answers
ohnoeight
1
170
Devin プロモコードの受け取りと適用(2026.10.27)
kinopeee
1
760
GitHub、使う?使わない?
happysamurai294
0
120
Lint の層を組み直した話
bengo4com
1
260
素人でもできた!AIを使った短編小説創作入門
delhi09
PRO
0
250
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
110
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
560
Thoughts on Productivity
jonyablonski
76
5.4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
440
Claude Code のすすめ
schroneko
67
230k
Test your architecture with Archunit
thirion
2
2.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
590
Unsuck your backbone
ammeep
672
58k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
320
Transcript
None
Vitor Mendrone Founder - Lukin Senior Developer - Work &
Co
/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
None
Expressões Regulares
String Padrões Combinar Localizar Gerenciar
None
Literal Constante Construtor de Objeto Padrão desconhecido
/pattern/flag New RegExp(pattern, flag)
Pattern /meetup-html/g
Flags /meetup-html/g
G Global I Ignore Case M Multiline
.test() .exec()
.test()
.exec()
Meta-characters \d Dígitos (Igual a [0-9]) \w Alfanuméricos e Underline
(Igual a [a-zA-Z0–9_]) \s Espaços e tabs . Qualquer caractere exceto line-breaks
Quantificadores ^ Inicio da string $ Fim da string +
Uma ou mais vezes
Mais Quantificadores {N} N ocorrências da expressão {N,} N ou
mais ocorrências da expressão {N,M} De N a M ocorrências da expressão
Escape / Alternância \ Escapa o próximo caractere (Ex.: \.)
| Ou
Grouping [] Grupo de caracteres () Grupo de captura
None
Validar um CPF!
Validar um CPF! const cpfRegex = //
Definindo uma flag! (Ou Não) const cpfRegex = //
Adicionando limites const cpfRegex = /^$/
NNN.NNN.NNN-NN \d.\d.\d-\d
const cpfRegex = /^\d$/ Meta-characters!
Quantificadores! const cpfRegex = /^\d\d … const cpfRegex = /^\d{3}&/
Escapando! const cpfRegex = /^\d{3}\.$/
const cpfRegex = /^\d{3}\.\d{3}\.\d{3}\-\d{2}$/
https:/ /regexr.com
Obrigado!
[email protected]
Twitter: @vhmendrone