Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Expressões Regulares
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Vitor Mendrone
January 23, 2020
Technology
46
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
83
A arte da composição
mendrone
0
38
Como escolher uma stack para meu projeto?
mendrone
0
31
Future Proof CSS - 2019
mendrone
0
79
Vue.js - O Antes, o Durante e o Depois
mendrone
0
120
Future Proof CSS
mendrone
1
120
High Speed Workflow
mendrone
4
140
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
89
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
75
Other Decks in Technology
See All in Technology
【CEDEC2026】コードレビュー支援ツール開発から学ぶ:LLMを用いた業務システムの実践的な運用設計と誤出力対策
cygames
PRO
0
630
ガバメントクラウドでのランサムウェア対策
techniczna
2
1k
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
2
700
Pavlokで始める電撃駆動開発
sgrsn
0
180
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
モダンフロントエンド 開発研修
recruitengineers
PRO
4
570
20分でわかるセキュアAPI
nwiizo
2
210
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
210
QAエンジニア起点で進める、SmartHRにおける信頼性向上について
kaomi_wombat
1
120
強化学習「理論」入門
enakai00
3
3.6k
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
160
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
380
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
200
Rails Girls Zürich Keynote
gr2m
96
14k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
450
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Agile that works and the tools we love
rasmusluckow
331
22k
A designer walks into a library…
pauljervisheath
211
24k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
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