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
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
66
Other Decks in Technology
See All in Technology
MLOps導入のための組織作りの第一歩
akasan
0
370
AI: Making Admin and Users, Lives Better
kbmsg
0
110
ServiceNow Knowledge 26 の歩き方
manarobot
0
160
はじめての MagicPod生成AI機能 機能紹介から活用方法まで
magicpod
0
120
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
770
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
140
コードや知識を組み込む / Incorporate Code and Knowledge
ks91
PRO
0
170
The Journey of Box Building
tagomoris
4
3.5k
エージェントスキルを作って自分のインプットに役立てよう
tsubakimoto_s
0
440
AndroidアプリとCopilot Studioの統合
nakasho
0
150
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
140
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
3
450
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
YesSQL, Process and Tooling at Scale
rocio
174
15k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
430
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
410
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
530
Context Engineering - Making Every Token Count
addyosmani
9
840
Google's AI Overviews - The New Search
badams
0
980
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.4k
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