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
43
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
82
A arte da composição
mendrone
0
36
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
Ruby::Boxでできること、Refinementsでできること
joker1007
3
380
大学生が本気でDatabricksを活用してDiscordサークルをデータ駆動させてみた
phantomjuju
1
340
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
1
320
AI と創る新たな世界 / A New World Created with AI
ks91
PRO
0
110
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
3
3k
Cloud Run のアップデート 触ってみる&紹介
gre212
0
300
Diagnosing performance problems without the guesswork
elenatanasoiu
0
160
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
2.4k
はじめてのDatadog
kairim0
0
270
GoとSIMDとWasmの今。
askua
3
490
「気づいたら仕事が終わっている」バクラクAIエージェント本番運用の裏側 / layerx-bakuraku-aie2026
yuya4
18
9.6k
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
180
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Visualization
eitanlees
152
17k
Being A Developer After 40
akosma
91
590k
Abbi's Birthday
coloredviolet
2
7.9k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
Chasing Engaging Ingredients in Design
codingconduct
0
210
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
820
Mobile First: as difficult as doing things right
swwweet
225
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
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