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
Vitor Mendrone
January 23, 2020
Technology
45
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
37
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
71
Other Decks in Technology
See All in Technology
Alphaモジュール使っていいのかい!?いけないのかい!?どっちなんだいっ!?
watany
1
290
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
280
ガバナンスの「ちょうどいい落とし所」を探れ!開発スピードを妨げない運用判断の勘所 / SRE NEXT 2026
genda
1
260
Gen3R: 3D Scene Generation Meets Feed-Forward Reconstruction
spatial_ai_network
0
140
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
1k
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
0
140
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
150
実践!既存 Project への AI-Driven Development 適用〜 一ヶ月で Project 唯一のフロントエンドエンジニアを作り出せ〜
lycorptech_jp
PRO
0
250
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
0
130
関数型の考えを TypeScript に持ち込んで、テストしやすい純粋関数を増やす / Pure at the Core, Effects at the Edge: Bringing Functional Thinking into TypeScript
kaminashi
2
130
オブザーバビリティ、本当に活用できてる? 〜API連携×生成AIで成熟度を自動評価〜
dmmsre
1
3.6k
AICoEでAIネイティブ組織への進化
yukiogawa
0
200
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.4k
Deep Space Network (abreviated)
tonyrice
0
230
Context Engineering - Making Every Token Count
addyosmani
9
1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
650
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
4 Signs Your Business is Dying
shpigford
187
22k
sira's awesome portfolio website redesign presentation
elsirapls
0
300
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
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