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
0
33
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
76
A arte da composição
mendrone
0
24
Como escolher uma stack para meu projeto?
mendrone
0
25
Future Proof CSS - 2019
mendrone
0
73
Vue.js - O Antes, o Durante e o Depois
mendrone
0
110
Future Proof CSS
mendrone
1
100
High Speed Workflow
mendrone
4
140
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
81
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
59
Other Decks in Technology
See All in Technology
Redshift認可、アップデートでどう変わった?
handy
1
120
Oracle Cloud Infrastructure:2025年12月度サービス・アップデート
oracle4engineer
PRO
0
180
チームで安全にClaude Codeを利用するためのプラクティス / team-claude-code-practices
tomoki10
5
1.9k
Qiita Bash アドカレ LT #1
okaru
0
160
小さく、早く、可能性を多産する。生成AIプロジェクト / prAIrie-dog
visional_engineering_and_design
0
320
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
290
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
290
迷わない!AI×MCP連携のリファレンスアーキテクチャ完全ガイド
cdataj
0
160
Introduction to Bill One Development Engineer
sansan33
PRO
0
340
田舎で20年スクラム(後編):一個人が企業で長期戦アジャイルに挑む意味
chinmo
1
940
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
310
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
WCS-LA-2024
lcolladotor
0
400
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
330
Into the Great Unknown - MozCon
thekraken
40
2.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
0
37
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
97
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Statistics for Hackers
jakevdp
799
230k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
140
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
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