$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Expressões Regulares
Search
Vitor Mendrone
January 23, 2020
Technology
0
32
Expressões Regulares
O mínimo que você precisa saber sobre expressões regulares para parecer um gênio.
Vitor Mendrone
January 23, 2020
Tweet
Share
More Decks by Vitor Mendrone
See All by Vitor Mendrone
Como se tornar indispensável em um mercado em crise?
mendrone
0
75
A arte da composição
mendrone
0
22
Como escolher uma stack para meu projeto?
mendrone
0
23
Future Proof CSS - 2019
mendrone
0
72
Vue.js - O Antes, o Durante e o Depois
mendrone
0
100
Future Proof CSS
mendrone
1
100
High Speed Workflow
mendrone
4
140
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
80
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
58
Other Decks in Technology
See All in Technology
Playwrightのソースコードに見る、自動テストを自動で書く技術
yusukeiwaki
12
4.3k
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
0
560
Gemini でコードレビュー知見を見える化
zozotech
PRO
1
130
Modern Data Stack大好きマンが語るSnowflakeの魅力
sagara
0
300
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
1.1k
Karate+Database RiderによるAPI自動テスト導入工数をCline+GitLab MCPを使って2割削減を目指す! / 20251206 Kazuki Takahashi
shift_evolve
PRO
1
330
AWS Bedrock AgentCoreで作る 1on1支援AIエージェント 〜Memory × Evaluationsによる実践開発〜
yusukeshimizu
4
270
pmconf2025 - データを活用し「価値」へ繋げる
glorypulse
0
630
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
800
Docker, Infraestructuras seguras y Hardening
josejuansanchez
0
150
小さな判断で育つ、大きな意思決定力 / 20251204 Takahiro Kinjo
shift_evolve
PRO
1
500
シンプルを極める。アンチパターンなDB設計の本質
facilo_inc
2
1.6k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Unsuck your backbone
ammeep
671
58k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Code Reviewing Like a Champion
maltzj
527
40k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
69k
Speed Design
sergeychernyshev
33
1.4k
Fireside Chat
paigeccino
41
3.7k
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