From f008b7c2910f75d6a9b861452cb8641b96764885 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 17:26:39 -0300 Subject: [PATCH] translating 'basic matches' --- README-pt_BR.md | 69 +++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index c381e43..d3d01ae 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -57,24 +57,21 @@ A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_a ## 1. Combinações Básicas -A regular expression is just a pattern of characters that we use to perform search in a text. For example, the regular expression -`the` means: the letter `t`, followed by the letter `h`, followed by the letter `e`. +Uma expressão regular é apenas um padrão de caracteres que usamos para fazer busca em um texto. Por exemplo, a expressão regular `the` significa: a letra `t`, seguida da letra `h`, seguida da letra `e`.
 "the" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/dmRygT/1) +[Teste a RegExp](https://regex101.com/r/dmRygT/1) -The regular expression `123` matches the string `123`. The regular expression is matched against an input string by comparing each -character in the regular expression to each character in the input string, one after another. Regular expressions are normally -case-sensitive so the regular expression `The` would not match the string `the`. +A expressão regular `123` corresponde a string `123`. A expressão regular é comparada com uma string de entrada, comparando cada caractere da expressão regular para cada caractere da string de entrada, um após o outro. Expressões regulares são normalmente case-sensitive (sensíveis à maiúsculas), então a expressão regular `The` não vai bater com a string `the`.
 "The" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/1paXsy/1) +[Teste a RegExp](https://regex101.com/r/1paXsy/1) ## 2. Metacaracteres @@ -107,7 +104,7 @@ letter `r`. ".ar" => The car parked in the garage. -[Test the regular expression](https://regex101.com/r/xc9GkU/1) +[Teste a RegExp](https://regex101.com/r/xc9GkU/1) ## 2.2 Conjunto de caracteres @@ -119,7 +116,7 @@ expression `[Tt]he` means: an uppercase `T` or lowercase `t`, followed by the le "[Tt]he" => The car parked in the garage. -[Test the regular expression](https://regex101.com/r/2ITLQ4/1) +[Teste a RegExp](https://regex101.com/r/2ITLQ4/1) A period inside a character set, however, means a literal period. The regular expression `ar[.]` means: a lowercase character `a`, followed by letter `r`, followed by a period `.` character. @@ -127,7 +124,7 @@ A period inside a character set, however, means a literal period. The regular ex "ar[.]" => A garage is a good place to park a car. -[Test the regular expression](https://regex101.com/r/wL3xtE/1) +[Teste a RegExp](https://regex101.com/r/wL3xtE/1) ### 2.2.1 Conjunto de caracteres negados @@ -139,7 +136,7 @@ the letter `r`. "[^c]ar" => The car parked in the garage. -[Test the regular expression](https://regex101.com/r/nNNlq3/1) +[Teste a RegExp](https://regex101.com/r/nNNlq3/1) ## 2.3 Repetições @@ -156,7 +153,7 @@ character set. For example, the regular expression `[a-z]*` means: any number of "[a-z]*" => The car parked in the garage #21. -[Test the regular expression](https://regex101.com/r/7m8me5/1) +[Teste a RegExp](https://regex101.com/r/7m8me5/1) The `*` symbol can be used with the meta character `.` to match any string of characters `.*`. The `*` symbol can be used with the whitespace character `\s` to match a string of whitespace characters. For example, the expression `\s*cat\s*` means: zero or more @@ -167,7 +164,7 @@ zero or more spaces. "\s*cat\s*" => The fat cat sat on the concatenation. -[Test the regular expression](https://regex101.com/r/gGrwuz/1) +[Teste a RegExp](https://regex101.com/r/gGrwuz/1) ### 2.3.2 O Sinal de Adição @@ -178,7 +175,7 @@ letter `c`, followed by at least one character, followed by the lowercase charac "c.+t" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/Dzf9Aa/1) +[Teste a RegExp](https://regex101.com/r/Dzf9Aa/1) ### 2.3.3 O Ponto de Interrogação @@ -190,13 +187,13 @@ character `h`, followed by the lowercase character `e`. "[T]he" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/cIg9zm/1) +[Teste a RegExp](https://regex101.com/r/cIg9zm/1)
 "[T]?he" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/kPpO2x/1) +[Teste a RegExp](https://regex101.com/r/kPpO2x/1) ## 2.4 Chaves @@ -208,7 +205,7 @@ characters in the range of 0 to 9). "[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0. -[Test the regular expression](https://regex101.com/r/juM86s/1) +[Teste a RegExp](https://regex101.com/r/juM86s/1) We can leave out the second number. For example, the regular expression `[0-9]{2,}` means: Match 2 or more digits. If we also remove the comma the regular expression `[0-9]{3}` means: Match exactly 3 digits. @@ -217,13 +214,13 @@ the comma the regular expression `[0-9]{3}` means: Match exactly 3 digits. "[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0. -[Test the regular expression](https://regex101.com/r/Gdy4w5/1) +[Teste a RegExp](https://regex101.com/r/Gdy4w5/1)
 "[0-9]{3}" => The number was 9.9997 but we rounded it off to 10.0.
 
-[Test the regular expression](https://regex101.com/r/Sivu30/1) +[Teste a RegExp](https://regex101.com/r/Sivu30/1) ## 2.5 Grupo de Caracteres @@ -237,7 +234,7 @@ We can also use the alternation `|` meta character inside character group. For e "(c|g|p)ar" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/tUxrBG/1) +[Teste a RegExp](https://regex101.com/r/tUxrBG/1) ## 2.6 Alternância @@ -251,7 +248,7 @@ or lowercase character `c`, followed by lowercase character `a`, followed by low "(T|t)he|car" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/fBXyX0/1) +[Teste a RegExp](https://regex101.com/r/fBXyX0/1) ## 2.7 Escapando Caracteres Especiais @@ -265,7 +262,7 @@ expression `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by l "(f|c|m)at\.?" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/DOc5Nu/1) +[Teste a RegExp](https://regex101.com/r/DOc5Nu/1) ## 2.8 Âncoras @@ -286,13 +283,13 @@ followed by lowercase character `h`, followed by lowercase character `e`. "(T|t)he" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/5ljjgB/1) +[Teste a RegExp](https://regex101.com/r/5ljjgB/1)
 "^(T|t)he" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/jXrKne/1) +[Teste a RegExp](https://regex101.com/r/jXrKne/1) ### 2.8.2 Sinal de Dólar @@ -304,13 +301,13 @@ must be end of the string. "(at\.)" => The fat cat. sat. on the mat. -[Test the regular expression](https://regex101.com/r/y4Au4D/1) +[Teste a RegExp](https://regex101.com/r/y4Au4D/1)
 "(at\.)$" => The fat cat. sat. on the mat.
 
-[Test the regular expression](https://regex101.com/r/t0AkOd/1) +[Teste a RegExp](https://regex101.com/r/t0AkOd/1) ## 3. Forma Abreviada de Conjunto de Caracteres @@ -355,7 +352,7 @@ followed by letter `h`, followed by letter `e`. In parentheses we define positiv "[T|t]he(?=\sfat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/IDDARt/1) +[Teste a RegExp](https://regex101.com/r/IDDARt/1) ### 4.2 Lookahead Negativo @@ -368,7 +365,7 @@ input string that are not followed by the word `fat` precedes by a space charact "[T|t]he(?!\sfat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/V32Npg/1) +[Teste a RegExp](https://regex101.com/r/V32Npg/1) ### 4.3 Lookbehind Positivo @@ -380,7 +377,7 @@ are after the word `The` or `the`. "(?<=[T|t]he\s)(fat|mat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/avH165/1) +[Teste a RegExp](https://regex101.com/r/avH165/1) ### 4.4 Lookbehind Negativo @@ -392,7 +389,7 @@ are not after the word `The` or `the`. "(?<![T|t]he\s)(cat)" => The cat sat on cat. -[Test the regular expression](https://regex101.com/r/8Efx5G/1) +[Teste a RegExp](https://regex101.com/r/8Efx5G/1) ## 5. Flags @@ -416,13 +413,13 @@ the whole input string. "The" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/dpQyf9/1) +[Teste a RegExp](https://regex101.com/r/dpQyf9/1)
 "/The/gi" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/ahfiuh/1) +[Teste a RegExp](https://regex101.com/r/ahfiuh/1) ### 5.2 Busca Global @@ -435,13 +432,13 @@ string. "/.(at)/" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/jnk6gM/1) +[Teste a RegExp](https://regex101.com/r/jnk6gM/1)
 "/.(at)/g" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/dO1nef/1) +[Teste a RegExp](https://regex101.com/r/dO1nef/1) ### 5.3 Multilinhas @@ -456,7 +453,7 @@ line. And because of `m` flag now regular expression engine matches pattern at t on the mat. -[Test the regular expression](https://regex101.com/r/hoGMkP/1) +[Teste a RegExp](https://regex101.com/r/hoGMkP/1)
 "/.at(.)?$/gm" => The fat
@@ -464,7 +461,7 @@ line. And because of `m` flag now regular expression engine matches pattern at t
                   on the mat.
 
-[Test the regular expression](https://regex101.com/r/E88WE2/1) +[Teste a RegExp](https://regex101.com/r/E88WE2/1) ## Bônus