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
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
AIAU_UMEMOGU_ninomiya_slide
ninomiya_ii
0
260
AIはどのように 組織のアジリティを変えるのか?
junki
4
1.4k
AIが自律的に回る開発ループを設計してチーム開発に組み込む
nekorush14
0
130
5分でわかるDuckDB Quack
chanyou0311
3
250
レガシーな広告配信システムでのAI駆動開発/運用の挑戦
i16fujimoto
0
120
Oracle Cloud Infrastructure:2026年6月度サービス・アップデート
oracle4engineer
PRO
0
330
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
470
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
140
不要なレビューをAIにまかせて AIコーディングの環境改善を加速した
shoota
1
270
AI時代に求められる技術力 フロンティア・クリエイティビティ / Technical Excellence in the AI Era: Frontier Creativity
kaonavi
0
110
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
300
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
280
Are puppies a ranking factor?
jonoalderson
1
3.6k
Into the Great Unknown - MozCon
thekraken
41
2.6k
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