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
51
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
43
Como escolher uma stack para meu projeto?
mendrone
0
34
Future Proof CSS - 2019
mendrone
0
80
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
94
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
81
Other Decks in Technology
See All in Technology
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
290
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.3k
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
0
140
しろおびから始める!ログ活用の第一歩
shumei_ito
0
800
パッチ更新でterraform initが落ちた日
grimoh
1
100
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
630
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
5
4.3k
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
130
SDDの運用にめげずに向き合った話
sansantech
PRO
1
140
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
The seven pitfalls of AI (revised version)
ufried
0
310
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
A Tale of Four Properties
chriscoyier
163
24k
YesSQL, Process and Tooling at Scale
rocio
174
15k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
320
How GitHub (no longer) Works
holman
316
150k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
720
The SEO identity crisis: Don't let AI make you average
varn
0
580
The Mindset for Success: Future Career Progression
greggifford
PRO
0
530
Crafting Experiences
bethany
1
380
Music & Morning Musume
bryan
48
7.4k
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