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
27
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
72
A arte da composição
mendrone
0
17
Como escolher uma stack para meu projeto?
mendrone
0
13
Future Proof CSS - 2019
mendrone
0
54
Vue.js - O Antes, o Durante e o Depois
mendrone
0
97
Future Proof CSS
mendrone
1
91
High Speed Workflow
mendrone
4
130
Usabilidade - O bom senso é o seu melhor amigo
mendrone
0
75
Um Simples Checkup Pode Salvar a Sua Loja Virtual
mendrone
0
51
Other Decks in Technology
See All in Technology
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
18k
ルーターでプレゼンする
puhitaku
1
3.2k
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
1
360
Amplify 🩷 Bedrock 〜生成AI入門〜
minorun365
PRO
8
410
How to Lead? Testimonial of a Lead Android Engineer
oleur
1
110
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
710
Rustで「プリズモイダル法」を利用して「土量計算」をガチでやる
nokonoko1203
1
270
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
450
Azureの基本的な権限管理の勉強会
yhana
1
2k
KubeConにproposalを送りたい人へのアドバイス
sat
PRO
3
270
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
210
Featured
See All Featured
Infographics Made Easy
chrislema
238
18k
Unsuck your backbone
ammeep
663
57k
Agile that works and the tools we love
rasmusluckow
325
20k
The Mythical Team-Month
searls
216
42k
How to Ace a Technical Interview
jacobian
273
22k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Practical Orchestrator
shlominoach
183
9.7k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
A Tale of Four Properties
chriscoyier
152
22k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
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