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
37
0
Share
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
79
A arte da composição
mendrone
0
31
Como escolher uma stack para meu projeto?
mendrone
0
27
Future Proof CSS - 2019
mendrone
0
77
Vue.js - O Antes, o Durante e o Depois
mendrone
0
110
Future Proof CSS
mendrone
1
110
High Speed Workflow
mendrone
4
140
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
85
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
65
Other Decks in Technology
See All in Technology
サイボウズフロントエンドの活動から考える探究と発信
mugi_uno
0
110
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
170
Strands Agents × Amazon Bedrock AgentCoreで パーソナルAIエージェントを作ろう
yokomachi
2
160
第26回FA設備技術勉強会 - Claude/Claude_codeでデータ分析 -
happysamurai294
0
390
OPENLOGI Company Profile for engineer
hr01
1
62k
遊びで始めたNew Relic MCP、気づいたらChatOpsなオブザーバビリティボットができてました/From New Relic MCP to a ChatOps Observability Bot
aeonpeople
1
170
Databricks Appsで実現する社内向けAIアプリ開発の効率化
r_miura
0
320
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
380
OPENLOGI Company Profile
hr01
0
83k
自分をひらくと次のチャレンジの敷居が下がる
sudoakiy
5
1.8k
TanStack Start エコシステムの現在地 / TanStack Start Ecosystem 2026
iktakahiro
1
310
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
250
Amusing Abliteration
ianozsvald
1
150
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
510
Building Applications with DynamoDB
mza
96
7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
190
Facilitating Awesome Meetings
lara
57
6.8k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
470
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
430
Discover your Explorer Soul
emna__ayadi
2
1.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
470
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
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