From bcc9b0079d5c825d05d8d8d7b81c79e55b4a5779 Mon Sep 17 00:00:00 2001 From: Thiago May Date: Tue, 5 Oct 2021 20:09:22 -0300 Subject: [PATCH] Add chapter six translation to Portuguese --- translations/README-pt_BR.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/translations/README-pt_BR.md b/translations/README-pt_BR.md index 68db0e1..58dfe3b 100644 --- a/translations/README-pt_BR.md +++ b/translations/README-pt_BR.md @@ -78,6 +78,7 @@ A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_a - [Indiferente à Maiúsculas](#51-indiferente-à-maiúsculas) - [Busca Global](#52-busca-global) - [Multilinhas](#53-multilinhas) +- [Guloso vs Não-Guloso](#6-guloso-vs-não-guloso) ## 1. Combinações Básicas @@ -420,6 +421,23 @@ O modificador `m` é usado para realizar uma busca em várias linhas. Como falam [Teste a RegExp](https://regex101.com/r/E88WE2/1) +### 6. Guloso vs Não-Guloso + +Por padrão, uma regex irá realizar uma consulta gulosa, isto significa que a busca irá capturar ao padrão mais longo possível. Nós podemos usar `?` para buscar de uma forma não-gulosa, isto significa que a busca irá capturar ao padrão mais curto possível. + +
+"/(.*at)/" => The fat cat sat on the mat. 
+ + +[Teste a RegExp](https://regex101.com/r/AyAdgJ/1) + +
+"/(.*?at)/" => The fat cat sat on the mat. 
+ + +[Teste a RegExp](https://regex101.com/r/AyAdgJ/2) + + ## Contribution * Reporte bugs