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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
re:Inventで、人生は変わったのか? / growth-builders-hub-1-reinvent-2026
mhrtech
2
170
(swiftc) NonCopyableとライフタイム修飾子
teamhimeh
0
160
Snowflake でできることが増えたら、 ABAC が必要になった
kaeton
0
120
Vue で書く 空間コンピューティング、TresJS と WebXR を使ったXR デバイスのフロントエンド開発
hiranuma
0
140
Lint の層を組み直した話
bengo4com
1
260
kintoneで在庫管理システムを作るときの要件定義・設計ポイント
kai0707
0
190
[FECONF-2026] 신대륙을 향한 카카오페이증권 프론트엔드 항해기 (이주승)
l1ghthouse
0
330
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
580
[re:Invent2026事前勉強会(有志開催)]続きは、ラスベガスの廊下で / continue-in-the-vegas-hallway
sh_fk2
0
430
Maestro MCPとClaude Code Skillsによる自律的なE2Eテスト支援
asmz
0
390
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
370
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
160
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
340
Technical Leadership for Architectural Decision Making
baasie
3
620
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
610
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
420
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
660
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Paper Plane
katiecoart
PRO
5
54k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
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