From f86f2e94cee95fa1c5262c1db43820234dd0510e Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 09:29:08 -0300 Subject: [PATCH 01/22] starting translate --- README-pt_BR.md | 505 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 505 insertions(+) create mode 100644 README-pt_BR.md diff --git a/README-pt_BR.md b/README-pt_BR.md new file mode 100644 index 00000000..d26324ee --- /dev/null +++ b/README-pt_BR.md @@ -0,0 +1,505 @@ +
+

+Learn Regex +


+ +## Traduções: + +* [English](README.md) +* [中文版](README-cn.md) +* [日本語](README-ja.md) +* [Português do Brasil](README-pt_BR.md) + +## O que é uma Expressão Regular? + +> Expressão Regular é um grupo de caracteres ou símbolos que é usado para encontrar um padrão específico a partir de um texto. + +A regular expression is a pattern that is matched against a subject string from left to right. The word "Regular expression" is a +mouthful, you will usually find the term abbreviated as "regex" or "regexp". Regular expression is used for replacing a text within +a string, validating form, extract a substring from a string based upon a pattern match, and so much more. + +Imagine you are writing an application and you want to set the rules for when a user chooses their username. We want to +allow the username to contain letters, numbers, underscores and hyphens. We also want to limit the number of +characters in username so it does not look ugly. We use the following regular expression to validate a username: +

+

+Regular expression +

+ +Above regular expression can accept the strings `john_doe`, `jo-hn_doe` and `john12_as`. It does not match `Jo` because that string +contains uppercase letter and also it is too short. + +## Table of Contents + +- [Basic Matchers](#1-basic-matchers) +- [Meta character](#2-meta-characters) + - [Full stop](#21-full-stop) + - [Character set](#22-character-set) + - [Negated character set](#221-negated-character-set) + - [Repetitions](#23-repetitions) + - [The Star](#231-the-star) + - [The Plus](#232-the-plus) + - [The Question Mark](#233-the-question-mark) + - [Braces](#24-braces) + - [Character Group](#25-character-group) + - [Alternation](#26-alternation) + - [Escaping special character](#27-escaping-special-character) + - [Anchors](#28-anchors) + - [Caret](#281-caret) + - [Dollar](#282-dollar) +- [Shorthand Character Sets](#3-shorthand-character-sets) +- [Lookaround](#4-lookaround) + - [Positive Lookahead](#41-positive-lookahead) + - [Negative Lookahead](#42-negative-lookahead) + - [Positive Lookbehind](#43-positive-lookbehind) + - [Negative Lookbehind](#44-negative-lookbehind) +- [Flags](#5-flags) + - [Case Insensitive](#51-case-insensitive) + - [Global search](#52-global-search) + - [Multiline](#53-multiline) +- [Bonus](#bonus) + +## 1. Basic Matchers + +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`. + +
+"the" => The fat cat sat on the mat.
+
+ +[Test the regular expression](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`. + +
+"The" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/1paXsy/1) + +## 2. Meta Characters + +Meta characters are the building blocks of the regular expressions. Meta characters do not stand for themselves but instead are +interpreted in some special way. Some meta characters have a special meaning and are written inside square brackets. +The meta characters are as follows: + +|Meta character|Description| +|:----:|----| +|.|Period matches any single character except a line break.| +|[ ]|Character class. Matches any character contained between the square brackets.| +|[^ ]|Negated character class. Matches any character that is not contained between the square brackets| +|*|Matches 0 or more repetitions of the preceding symbol.| +|+|Matches 1 or more repetitions of the preceding symbol. +|?|Makes the preceding symbol optional.| +|{n,m}|Braces. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| +|(xyz)|Character group. Matches the characters xyz in that exact order.| +|||Alternation. Matches either the characters before or the characters after the symbol.| +|\|Escapes the next character. This allows you to match reserved characters [ ] ( ) { } . * + ? ^ $ \ || +|^|Matches the beginning of the input.| +|$|Matches the end of the input.| + +## 2.1 Full stop + +Full stop `.` is the simplest example of meta character. The meta character `.` matches any single character. It will not match return +or newline characters. For example, the regular expression `.ar` means: any character, followed by the letter `a`, followed by the +letter `r`. + +
+".ar" => The car parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/xc9GkU/1) + +## 2.2 Character set + +Character sets are also called character class. Square brackets are used to specify character sets. Use a hyphen inside a character set to +specify the characters' range. The order of the character range inside square brackets doesn't matter. For example, the regular +expression `[Tt]he` means: an uppercase `T` or lowercase `t`, followed by the letter `h`, followed by the letter `e`. + +
+"[Tt]he" => The car parked in the garage.
+
+ +[Test the regular expression](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. + +
+"ar[.]" => A garage is a good place to park a car.
+
+ +[Test the regular expression](https://regex101.com/r/wL3xtE/1) + +### 2.2.1 Negated character set + +In general, the caret symbol represents the start of the string, but when it is typed after the opening square bracket it negates the +character set. For example, the regular expression `[^c]ar` means: any character except `c`, followed by the character `a`, followed by +the letter `r`. + +
+"[^c]ar" => The car parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/nNNlq3/1) + +## 2.3 Repetitions + +Following meta characters `+`, `*` or `?` are used to specify how many times a subpattern can occur. These meta characters act +differently in different situations. + +### 2.3.1 The Star + +The symbol `*` matches zero or more repetitions of the preceding matcher. The regular expression `a*` means: zero or more repetitions +of preceding lowercase character `a`. But if it appears after a character set or class then it finds the repetitions of the whole +character set. For example, the regular expression `[a-z]*` means: any number of lowercase letters in a row. + +
+"[a-z]*" => The car parked in the garage #21.
+
+ +[Test the regular expression](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 +spaces, followed by lowercase character `c`, followed by lowercase character `a`, followed by lowercase character `t`, followed by +zero or more spaces. + +
+"\s*cat\s*" => The fat cat sat on the concatenation.
+
+ +[Test the regular expression](https://regex101.com/r/gGrwuz/1) + +### 2.3.2 The Plus + +The symbol `+` matches one or more repetitions of the preceding character. For example, the regular expression `c.+t` means: lowercase +letter `c`, followed by at least one character, followed by the lowercase character `t`. + +
+"c.+t" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/Dzf9Aa/1) + +### 2.3.3 The Question Mark + +In regular expression the meta character `?` makes the preceding character optional. This symbol matches zero or one instance of +the preceding character. For example, the regular expression `[T]?he` means: Optional the uppercase letter `T`, followed by the lowercase +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) + +
+"[T]?he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/kPpO2x/1) + +## 2.4 Braces + +In regular expression braces that are also called quantifiers are used to specify the number of times that a +character or a group of characters can be repeated. For example, the regular expression `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 ( +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) + +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. + +
+"[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) + +
+"[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) + +## 2.5 Character Group + +Character group is a group of sub-patterns that is written inside Parentheses `(...)`. As we discussed before that in regular expression +if we put a quantifier after a character then it will repeat the preceding character. But if we put quantifier after a character group then +it repeats the whole character group. For example, the regular expression `(ab)*` matches zero or more repetitions of the character "ab". +We can also use the alternation `|` meta character inside character group. For example, the regular expression `(c|g|p)ar` means: lowercase character `c`, +`g` or `p`, followed by character `a`, followed by character `r`. + +
+"(c|g|p)ar" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/tUxrBG/1) + +## 2.6 Alternation + +In regular expression Vertical bar `|` is used to define alternation. Alternation is like a condition between multiple expressions. Now, +you may be thinking that character set and alternation works the same way. But the big difference between character set and alternation +is that character set works on character level but alternation works on expression level. For example, the regular expression +`(T|t)he|car` means: uppercase character `T` or lowercase `t`, followed by lowercase character `h`, followed by lowercase character `e` +or lowercase character `c`, followed by lowercase character `a`, followed by lowercase character `r`. + +
+"(T|t)he|car" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/fBXyX0/1) + +## 2.7 Escaping special character + +Backslash `\` is used in regular expression to escape the next character. This allows to to specify a symbol as a matching character +including reserved characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching character prepend `\` before it. +For example, the regular expression `.` is used to match any character except newline. Now to match `.` in an input string the regular +expression `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by lowercase character `a`, followed by lowercase letter +`t`, followed by optional `.` character. + +
+"(f|c|m)at\.?" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/DOc5Nu/1) + +## 2.8 Anchors + +In regular expressions, we use anchors to check if the matching symbol is the starting symbol or ending symbol of the +input string. Anchors are of two types: First type is Caret `^` that check if the matching character is the start +character of the input and the second type is Dollar `$` that checks if matching character is the last character of the +input string. + +### 2.8.1 Caret + +Caret `^` symbol is used to check if matching character is the first character of the input string. If we apply the following regular +expression `^a` (if a is the starting symbol) to input string `abc` it matches `a`. But if we apply regular expression `^b` on above +input string it does not match anything. Because in input string `abc` "b" is not the starting symbol. Let's take a look at another +regular expression `^(T|t)he` which means: uppercase character `T` or lowercase character `t` is the start symbol of the input string, +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) + +
+"^(T|t)he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/jXrKne/1) + +### 2.8.2 Dollar + +Dollar `$` symbol is used to check if matching character is the last character of the input string. For example, regular expression +`(at\.)$` means: a lowercase character `a`, followed by lowercase character `t`, followed by a `.` character and the matcher +must be end of the string. + +
+"(at\.)" => The fat cat. sat. on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/y4Au4D/1) + +
+"(at\.)$" => The fat cat. sat. on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/t0AkOd/1) + +## 3. Shorthand Character Sets + +Regular expression provides shorthands for the commonly used character sets, which offer convenient shorthands for commonly used +regular expressions. The shorthand character sets are as follows: + +|Shorthand|Description| +|:----:|----| +|.|Any character except new line| +|\w|Matches alphanumeric characters: `[a-zA-Z0-9_]`| +|\W|Matches non-alphanumeric characters: `[^\w]`| +|\d|Matches digit: `[0-9]`| +|\D|Matches non-digit: `[^\d]`| +|\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`| +|\S|Matches non-whitespace character: `[^\s]`| + +## 4. Lookaround + +Lookbehind and lookahead sometimes known as lookaround are specific type of ***non-capturing group*** (Use to match the pattern but not +included in matching list). Lookaheads are used when we have the condition that this pattern is preceded or followed by another certain +pattern. For example, we want to get all numbers that are preceded by `$` character from the following input string `$4.44 and $10.88`. +We will use following regular expression `(?<=\$)[0-9\.]*` which means: get all the numbers which contain `.` character and are preceded +by `$` character. Following are the lookarounds that are used in regular expressions: + +|Symbol|Description| +|:----:|----| +|?=|Positive Lookahead| +|?!|Negative Lookahead| +|?<=|Positive Lookbehind| +|? +"[T|t]he(?=\sfat)" => The fat cat sat on the mat. + + +[Test the regular expression](https://regex101.com/r/IDDARt/1) + +### 4.2 Negative Lookahead + +Negative lookahead is used when we need to get all matches from input string that are not followed by a pattern. Negative lookahead +defined same as we define positive lookahead but the only difference is instead of equal `=` character we use negation `!` character +i.e. `(?!...)`. Let's take a look at the following regular expression `[T|t]he(?!\sfat)` which means: get all `The` or `the` words from +input string that are not followed by the word `fat` precedes by a space character. + +
+"[T|t]he(?!\sfat)" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/V32Npg/1) + +### 4.3 Positive Lookbehind + +Positive lookbehind is used to get all the matches that are preceded by a specific pattern. Positive lookbehind is denoted by +`(?<=...)`. For example, the regular expression `(?<=[T|t]he\s)(fat|mat)` means: get all `fat` or `mat` words from input string that +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) + +### 4.4 Negative Lookbehind + +Negative lookbehind is used to get all the matches that are not preceded by a specific pattern. Negative lookbehind is denoted by +`(? +"(?<![T|t]he\s)(cat)" => The cat sat on cat. + + +[Test the regular expression](https://regex101.com/r/8Efx5G/1) + +## 5. Flags + +Flags are also called modifiers because they modify the output of a regular expression. These flags can be used in any order or +combination, and are an integral part of the RegExp. + +|Flag|Description| +|:----:|----| +|i|Case insensitive: Sets matching to be case-insensitive.| +|g|Global Search: Search for a pattern throughout the input string.| +|m|Multiline: Anchor meta character works on each line.| + +### 5.1 Case Insensitive + +The `i` modifier is used to perform case-insensitive matching. For example, the regular expression `/The/gi` means: uppercase letter +`T`, followed by lowercase character `h`, followed by character `e`. And at the end of regular expression the `i` flag tells the +regular expression engine to ignore the case. As you can see we also provided `g` flag because we want to search for the pattern in +the whole input string. + +
+"The" => The fat cat sat on the mat.
+
+ +[Test the regular expression](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) + +### 5.2 Global search + +The `g` modifier is used to perform a global match (find all matches rather than stopping after the first match). For example, the +regular expression`/.(at)/g` means: any character except new line, followed by lowercase character `a`, followed by lowercase +character `t`. Because we provided `g` flag at the end of the regular expression now it will find every matches from whole input +string. + +
+"/.(at)/" => The fat cat sat on the mat.
+
+ +[Test the regular expression](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) + +### 5.3 Multiline + +The `m` modifier is used to perform a multi-line match. As we discussed earlier anchors `(^, $)` are used to check if pattern is +the beginning of the input or end of the input string. But if we want that anchors works on each line we use `m` flag. For example, the +regular expression `/at(.)?$/gm` means: lowercase character `a`, followed by lowercase character `t`, optionally anything except new +line. And because of `m` flag now regular expression engine matches pattern at the end of each line in a string. + +
+"/.at(.)?$/" => The fat
+                cat sat
+                on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/hoGMkP/1) + +
+"/.at(.)?$/gm" => The fat
+                  cat sat
+                  on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/E88WE2/1) + +## Bonus + +* *Positive Integers*: `^\d+$` +* *Negative Integers*: `^-\d+$` +* *US Phone Number*: `^+?[\d\s]{3,}$` +* *US Phone with code*: `^+?[\d\s]+(?[\d\s]{10,}$` +* *Integers*: `^-?\d+$` +* *Username*: `^[\w.]{4,16}$` +* *Alpha-numeric characters*: `^[a-zA-Z0-9]*$` +* *Alpha-numeric characters with spaces*: `^[a-zA-Z0-9 ]*$` +* *Password*: `^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$` +* *email*: `^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})*$` +* *IPv4 address*: `^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$` +* *Lowercase letters only*: `^([a-z])*$` +* *Uppercase letters only*: `^([A-Z])*$` +* *URL*: `^(((http|https|ftp):\/\/)?([[a-zA-Z0-9]\-\.])+(\.)([[a-zA-Z0-9]]){2,4}([[a-zA-Z0-9]\/+=%&_\.~?\-]*))*$` +* *VISA credit card numbers*: `^(4[0-9]{12}(?:[0-9]{3})?)*$` +* *Date (DD/MM/YYYY)*: `^(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9]{2}$` +* *Date (MM/DD/YYYY)*: `^(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}$` +* *Date (YYYY/MM/DD)*: `^(19|20)?[0-9]{2}[- /.](0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])$` +* *MasterCard credit card numbers*: `^(5[1-5][0-9]{14})*$` +* *Hashtags*: Including hashtags with preceding text (abc123#xyz456) or containing white spaces within square brackets (#[foo bar]) : `\S*#(?:\[[^\]]+\]|\S+)` +* *@mentions*: `\B@[a-z0-9_-]+` +## Contribution + +* Report issues +* Open pull request with improvements +* Spread the word +* Reach out to me directly at ziishaned@gmail.com or [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) + +## License + +MIT © [Zeeshan Ahmed](mailto:ziishaned@gmail.com) From e3880980f03816563542feb73cdd0a5a1d9e497d Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 10:35:40 -0300 Subject: [PATCH 02/22] add link to pt_BR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5627cfa5..3dd3af5b 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ * [English](README.md) * [中文版](README-cn.md) * [日本語](README-ja.md) +* [Português do Brasil](README-pt_BR.md) ## What is Regular Expression? From 83baea8bbf5744a8b56f8c544931de7bbb992117 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 10:36:52 -0300 Subject: [PATCH 03/22] translating... --- README-pt_BR.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index d26324ee..cf98a3e6 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -12,11 +12,9 @@ ## O que é uma Expressão Regular? -> Expressão Regular é um grupo de caracteres ou símbolos que é usado para encontrar um padrão específico a partir de um texto. +> Expressão Regular é um grupo de caracteres ou símbolos utilizado para encontrar um padrão específico a partir de um texto. -A regular expression is a pattern that is matched against a subject string from left to right. The word "Regular expression" is a -mouthful, you will usually find the term abbreviated as "regex" or "regexp". Regular expression is used for replacing a text within -a string, validating form, extract a substring from a string based upon a pattern match, and so much more. +Uma expressão regular é um padrão que é comparado com uma cadeia de caracteres da esquerda para a direita. A expressão "Expressão regular" é longa e difícil de falar, você geralmente vai encontrar o termo abreviado como "regex" ou "regexp". Expressões regulares são usadas para substituir um texto dentro de uma string, validar formulários, extrair uma parte de uma string baseada em um padrão encontrado e muito mais. Imagine you are writing an application and you want to set the rules for when a user chooses their username. We want to allow the username to contain letters, numbers, underscores and hyphens. We also want to limit the number of From 240ad07ce2830c77cea53c1d9d2e2f3d614c05bb Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 11:32:01 -0300 Subject: [PATCH 04/22] Intro: ok --- README-pt_BR.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index cf98a3e6..ecb5f3f2 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -16,16 +16,14 @@ Uma expressão regular é um padrão que é comparado com uma cadeia de caracteres da esquerda para a direita. A expressão "Expressão regular" é longa e difícil de falar, você geralmente vai encontrar o termo abreviado como "regex" ou "regexp". Expressões regulares são usadas para substituir um texto dentro de uma string, validar formulários, extrair uma parte de uma string baseada em um padrão encontrado e muito mais. -Imagine you are writing an application and you want to set the rules for when a user chooses their username. We want to -allow the username to contain letters, numbers, underscores and hyphens. We also want to limit the number of -characters in username so it does not look ugly. We use the following regular expression to validate a username: +Imagine que você está escrevendo uma aplicação e quer colocar regras para quando um usuário escolher seu username. Nós queremos permitir que o username contenha letras, números, underlines e hífens. Nós também queremos limitar o número de caracteres para não ficar muito feio. Então usamos a seguinte expressão regular para validar o username: +

Regular expression

-Above regular expression can accept the strings `john_doe`, `jo-hn_doe` and `john12_as`. It does not match `Jo` because that string -contains uppercase letter and also it is too short. +A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_as`. Ela não aceita `Jo` porque essa string contém letras maiúsculas e também é muito curta. ## Table of Contents From 50ec9a07e8fd7c9044505baf945469f9417963f6 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 16:50:57 -0300 Subject: [PATCH 05/22] translating titles --- README-pt_BR.md | 134 ++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index ecb5f3f2..bdb477f4 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -25,37 +25,37 @@ Imagine que você está escrevendo uma aplicação e quer colocar regras para qu A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_as`. Ela não aceita `Jo` porque essa string contém letras maiúsculas e também é muito curta. -## Table of Contents - -- [Basic Matchers](#1-basic-matchers) -- [Meta character](#2-meta-characters) - - [Full stop](#21-full-stop) - - [Character set](#22-character-set) - - [Negated character set](#221-negated-character-set) - - [Repetitions](#23-repetitions) - - [The Star](#231-the-star) - - [The Plus](#232-the-plus) - - [The Question Mark](#233-the-question-mark) - - [Braces](#24-braces) - - [Character Group](#25-character-group) - - [Alternation](#26-alternation) - - [Escaping special character](#27-escaping-special-character) - - [Anchors](#28-anchors) - - [Caret](#281-caret) - - [Dollar](#282-dollar) -- [Shorthand Character Sets](#3-shorthand-character-sets) -- [Lookaround](#4-lookaround) - - [Positive Lookahead](#41-positive-lookahead) - - [Negative Lookahead](#42-negative-lookahead) - - [Positive Lookbehind](#43-positive-lookbehind) - - [Negative Lookbehind](#44-negative-lookbehind) +## Sumário + +- [Combinações Básicas](#1-basic-matchers) +- [Metacaracteres](#2-meta-characters) + - [Ponto final](#21-full-stop) + - [Conjunto de caracteres](#22-character-set) + - [Conjunto de caracteres negados](#221-negated-character-set) + - [Repetições](#23-repetitions) + - [O Asterisco](#231-the-star) + - [O Sinal de Adição](#232-the-plus) + - [O Ponto de Interrogação](#233-the-question-mark) + - [Chaves](#24-braces) + - [Grupo de Caracteres](#25-character-group) + - [Alternância](#26-alternation) + - [Escapando Caracteres Especiais](#27-escaping-special-character) + - [Âncoras](#28-anchors) + - [Acento Circunflexo](#281-caret) + - [Sinal de Dólar](#282-dollar) +- [Forma Abreviada de Conjunto de Caracteres](#3-shorthand-character-sets) +- [Olhar ao Redor](#4-lookaround) + - [Lookahead Positivo](#41-positive-lookahead) + - [Lookahead Negativo](#42-negative-lookahead) + - [Lookbehind Positivo](#43-positive-lookbehind) + - [Lookbehind Negativo](#44-negative-lookbehind) - [Flags](#5-flags) - - [Case Insensitive](#51-case-insensitive) - - [Global search](#52-global-search) - - [Multiline](#53-multiline) -- [Bonus](#bonus) + - [Indiferente à Maiúsculas](#51-case-insensitive) + - [Busca Global](#52-global-search) + - [Multilinhas](#53-multiline) +- [Bônus](#bonus) -## 1. Basic Matchers +## 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`. @@ -76,7 +76,7 @@ case-sensitive so the regular expression `The` would not match the string `the`. [Test the regular expression](https://regex101.com/r/1paXsy/1) -## 2. Meta Characters +## 2. Metacaracteres Meta characters are the building blocks of the regular expressions. Meta characters do not stand for themselves but instead are interpreted in some special way. Some meta characters have a special meaning and are written inside square brackets. @@ -90,16 +90,16 @@ The meta characters are as follows: |*|Matches 0 or more repetitions of the preceding symbol.| |+|Matches 1 or more repetitions of the preceding symbol. |?|Makes the preceding symbol optional.| -|{n,m}|Braces. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| +|{n,m}|Chaves. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| |(xyz)|Character group. Matches the characters xyz in that exact order.| -|||Alternation. Matches either the characters before or the characters after the symbol.| +|||Alternância. Matches either the characters before or the characters after the symbol.| |\|Escapes the next character. This allows you to match reserved characters [ ] ( ) { } . * + ? ^ $ \ || |^|Matches the beginning of the input.| |$|Matches the end of the input.| -## 2.1 Full stop +## 2.1 Ponto final -Full stop `.` is the simplest example of meta character. The meta character `.` matches any single character. It will not match return +Ponto final `.` is the simplest example of meta character. The meta character `.` matches any single character. It will not match return or newline characters. For example, the regular expression `.ar` means: any character, followed by the letter `a`, followed by the letter `r`. @@ -109,7 +109,7 @@ letter `r`. [Test the regular expression](https://regex101.com/r/xc9GkU/1) -## 2.2 Character set +## 2.2 Conjunto de caracteres Character sets are also called character class. Square brackets are used to specify character sets. Use a hyphen inside a character set to specify the characters' range. The order of the character range inside square brackets doesn't matter. For example, the regular @@ -129,7 +129,7 @@ A period inside a character set, however, means a literal period. The regular ex [Test the regular expression](https://regex101.com/r/wL3xtE/1) -### 2.2.1 Negated character set +### 2.2.1 Conjunto de caracteres negados In general, the caret symbol represents the start of the string, but when it is typed after the opening square bracket it negates the character set. For example, the regular expression `[^c]ar` means: any character except `c`, followed by the character `a`, followed by @@ -141,12 +141,12 @@ the letter `r`. [Test the regular expression](https://regex101.com/r/nNNlq3/1) -## 2.3 Repetitions +## 2.3 Repetições Following meta characters `+`, `*` or `?` are used to specify how many times a subpattern can occur. These meta characters act differently in different situations. -### 2.3.1 The Star +### 2.3.1 O Asterisco The symbol `*` matches zero or more repetitions of the preceding matcher. The regular expression `a*` means: zero or more repetitions of preceding lowercase character `a`. But if it appears after a character set or class then it finds the repetitions of the whole @@ -169,7 +169,7 @@ zero or more spaces. [Test the regular expression](https://regex101.com/r/gGrwuz/1) -### 2.3.2 The Plus +### 2.3.2 O Sinal de Adição The symbol `+` matches one or more repetitions of the preceding character. For example, the regular expression `c.+t` means: lowercase letter `c`, followed by at least one character, followed by the lowercase character `t`. @@ -180,7 +180,7 @@ letter `c`, followed by at least one character, followed by the lowercase charac [Test the regular expression](https://regex101.com/r/Dzf9Aa/1) -### 2.3.3 The Question Mark +### 2.3.3 O Ponto de Interrogação In regular expression the meta character `?` makes the preceding character optional. This symbol matches zero or one instance of the preceding character. For example, the regular expression `[T]?he` means: Optional the uppercase letter `T`, followed by the lowercase @@ -198,7 +198,7 @@ character `h`, followed by the lowercase character `e`. [Test the regular expression](https://regex101.com/r/kPpO2x/1) -## 2.4 Braces +## 2.4 Chaves In regular expression braces that are also called quantifiers are used to specify the number of times that a character or a group of characters can be repeated. For example, the regular expression `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 ( @@ -225,7 +225,7 @@ the comma the regular expression `[0-9]{3}` means: Match exactly 3 digits. [Test the regular expression](https://regex101.com/r/Sivu30/1) -## 2.5 Character Group +## 2.5 Grupo de Caracteres Character group is a group of sub-patterns that is written inside Parentheses `(...)`. As we discussed before that in regular expression if we put a quantifier after a character then it will repeat the preceding character. But if we put quantifier after a character group then @@ -239,7 +239,7 @@ We can also use the alternation `|` meta character inside character group. For e [Test the regular expression](https://regex101.com/r/tUxrBG/1) -## 2.6 Alternation +## 2.6 Alternância In regular expression Vertical bar `|` is used to define alternation. Alternation is like a condition between multiple expressions. Now, you may be thinking that character set and alternation works the same way. But the big difference between character set and alternation @@ -253,7 +253,7 @@ or lowercase character `c`, followed by lowercase character `a`, followed by low [Test the regular expression](https://regex101.com/r/fBXyX0/1) -## 2.7 Escaping special character +## 2.7 Escapando Caracteres Especiais Backslash `\` is used in regular expression to escape the next character. This allows to to specify a symbol as a matching character including reserved characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching character prepend `\` before it. @@ -267,16 +267,16 @@ expression `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by l [Test the regular expression](https://regex101.com/r/DOc5Nu/1) -## 2.8 Anchors +## 2.8 Âncoras In regular expressions, we use anchors to check if the matching symbol is the starting symbol or ending symbol of the -input string. Anchors are of two types: First type is Caret `^` that check if the matching character is the start -character of the input and the second type is Dollar `$` that checks if matching character is the last character of the +input string. Âncoras are of two types: First type is Acento Circunflexo `^` that check if the matching character is the start +character of the input and the second type is Sinal de Dólar `$` that checks if matching character is the last character of the input string. -### 2.8.1 Caret +### 2.8.1 Acento Circunflexo -Caret `^` symbol is used to check if matching character is the first character of the input string. If we apply the following regular +Acento Circunflexo `^` symbol is used to check if matching character is the first character of the input string. If we apply the following regular expression `^a` (if a is the starting symbol) to input string `abc` it matches `a`. But if we apply regular expression `^b` on above input string it does not match anything. Because in input string `abc` "b" is not the starting symbol. Let's take a look at another regular expression `^(T|t)he` which means: uppercase character `T` or lowercase character `t` is the start symbol of the input string, @@ -294,9 +294,9 @@ followed by lowercase character `h`, followed by lowercase character `e`. [Test the regular expression](https://regex101.com/r/jXrKne/1) -### 2.8.2 Dollar +### 2.8.2 Sinal de Dólar -Dollar `$` symbol is used to check if matching character is the last character of the input string. For example, regular expression +Sinal de Dólar `$` symbol is used to check if matching character is the last character of the input string. For example, regular expression `(at\.)$` means: a lowercase character `a`, followed by lowercase character `t`, followed by a `.` character and the matcher must be end of the string. @@ -312,7 +312,7 @@ must be end of the string. [Test the regular expression](https://regex101.com/r/t0AkOd/1) -## 3. Shorthand Character Sets +## 3. Forma Abreviada de Conjunto de Caracteres Regular expression provides shorthands for the commonly used character sets, which offer convenient shorthands for commonly used regular expressions. The shorthand character sets are as follows: @@ -327,7 +327,7 @@ regular expressions. The shorthand character sets are as follows: |\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`| |\S|Matches non-whitespace character: `[^\s]`| -## 4. Lookaround +## 4. Olhar ao Redor Lookbehind and lookahead sometimes known as lookaround are specific type of ***non-capturing group*** (Use to match the pattern but not included in matching list). Lookaheads are used when we have the condition that this pattern is preceded or followed by another certain @@ -337,12 +337,12 @@ by `$` character. Following are the lookarounds that are used in regular express |Symbol|Description| |:----:|----| -|?=|Positive Lookahead| -|?!|Negative Lookahead| -|?<=|Positive Lookbehind| -|? Date: Tue, 15 Aug 2017 16:59:34 -0300 Subject: [PATCH 06/22] title links --- README-pt_BR.md | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index bdb477f4..c381e43e 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -27,33 +27,33 @@ A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_a ## Sumário -- [Combinações Básicas](#1-basic-matchers) -- [Metacaracteres](#2-meta-characters) - - [Ponto final](#21-full-stop) - - [Conjunto de caracteres](#22-character-set) - - [Conjunto de caracteres negados](#221-negated-character-set) - - [Repetições](#23-repetitions) - - [O Asterisco](#231-the-star) - - [O Sinal de Adição](#232-the-plus) - - [O Ponto de Interrogação](#233-the-question-mark) - - [Chaves](#24-braces) - - [Grupo de Caracteres](#25-character-group) - - [Alternância](#26-alternation) - - [Escapando Caracteres Especiais](#27-escaping-special-character) - - [Âncoras](#28-anchors) - - [Acento Circunflexo](#281-caret) - - [Sinal de Dólar](#282-dollar) -- [Forma Abreviada de Conjunto de Caracteres](#3-shorthand-character-sets) -- [Olhar ao Redor](#4-lookaround) - - [Lookahead Positivo](#41-positive-lookahead) - - [Lookahead Negativo](#42-negative-lookahead) - - [Lookbehind Positivo](#43-positive-lookbehind) - - [Lookbehind Negativo](#44-negative-lookbehind) +- [Combinações Básicas](#1-combinações-básicas) +- [Metacaracteres](#2-metacaracteres) + - [Ponto final](#21-ponto-final) + - [Conjunto de caracteres](#22-conjunto-de-caracteres) + - [Conjunto de caracteres negados](#221-conjunto-de-caracteres-negados) + - [Repetições](#23-repetições) + - [O Asterisco](#231-o-asterisco) + - [O Sinal de Adição](#232-o-sinal-de-adição) + - [O Ponto de Interrogação](#233-o-ponto-de-interrogação) + - [Chaves](#24-chaves) + - [Grupo de Caracteres](#25-grupo-de-caracteres) + - [Alternância](#26-alternância) + - [Escapando Caracteres Especiais](#27-escapando-caracteres-especiais) + - [Âncoras](#28-Âncoras) + - [Acento Circunflexo](#281-acento-circunflexo) + - [Sinal de Dólar](#282-sinal-de-dólar) +- [Forma Abreviada de Conjunto de Caracteres](#3-forma-abreviada-de-conjunto-de-caracteres) +- [Olhar ao Redor](#4-olhar-ao-redor) + - [Lookahead Positivo](#41-lookahead-positivo) + - [Lookahead Negativo](#42-lookahead-negativo) + - [Lookbehind Positivo](#43-lookbehind-positivo) + - [Lookbehind Negativo](#44-lookbehind-negativo) - [Flags](#5-flags) - - [Indiferente à Maiúsculas](#51-case-insensitive) - - [Busca Global](#52-global-search) - - [Multilinhas](#53-multiline) -- [Bônus](#bonus) + - [Indiferente à Maiúsculas](#51-indiferente-à-maiúsculas) + - [Busca Global](#52-busca-global) + - [Multilinhas](#53-multilinhas) +- [Bônus](#bônus) ## 1. Combinações Básicas From f008b7c2910f75d6a9b861452cb8641b96764885 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 17:26:39 -0300 Subject: [PATCH 07/22] 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 c381e43e..d3d01aef 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 From cf6dafebd94af3ae8e390a39618cc6f7d32970b8 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 17:55:36 -0300 Subject: [PATCH 08/22] translating 'meta characters' --- README-pt_BR.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index d3d01aef..53448510 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -75,24 +75,23 @@ A expressão regular `123` corresponde a string `123`. A expressão regular é c ## 2. Metacaracteres -Meta characters are the building blocks of the regular expressions. Meta characters do not stand for themselves but instead are -interpreted in some special way. Some meta characters have a special meaning and are written inside square brackets. -The meta characters are as follows: +Metacaracteres são elementos fundamentais das expressões regulares. Metacaracteres não representam a si mesmos mas, ao invés disso, são interpretados de uma forma especial. Alguns metacaracteres tem um significado especial e são escritos dentro de colchetes. +Os metacaracteres são os seguintes: -|Meta character|Description| +|Metacaracter|Descrição| |:----:|----| -|.|Period matches any single character except a line break.| -|[ ]|Character class. Matches any character contained between the square brackets.| -|[^ ]|Negated character class. Matches any character that is not contained between the square brackets| -|*|Matches 0 or more repetitions of the preceding symbol.| -|+|Matches 1 or more repetitions of the preceding symbol. -|?|Makes the preceding symbol optional.| -|{n,m}|Chaves. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| -|(xyz)|Character group. Matches the characters xyz in that exact order.| -|||Alternância. Matches either the characters before or the characters after the symbol.| -|\|Escapes the next character. This allows you to match reserved characters [ ] ( ) { } . * + ? ^ $ \ || -|^|Matches the beginning of the input.| -|$|Matches the end of the input.| +|.|Corresponde a qualquer caractere, exceto uma quebra de linha| +|[ ]|Classe de caracteres. Corresponde a qualquer caractere contido dentro dos colchetes.| +|[^ ]|Classe de caracteres negada. Corresponde a qualquer caractere que não está contido dentro dos colchetes.| +|*|Corresponde à 0 ou mais repetições do símbolo anterior.| +|+|Corresponde à 1 ou mais repetições do símbolo anterior.| +|?|Faz com que o símbolo anterior seja opcional.| +|{n,m}|Chaves. Corresponde à no mínimo "n" mas não mais que "m" repetições do símbolo anterior.| +|(xyz)|Grupo de caracteres. Corresponde aos caracteres xyz nesta exata ordem.| +|||Alternância. Corresponde os caracteres antes ou os caracteres depois do símbolo| +|\|Escapa o próximo caractere. Isso permite você utilizar os caracteres reservados [ ] ( ) { } . * + ? ^ $ \ || +|^|Corresponde ao início da entrada.| +|$|Corresponde ao final da entrada.| ## 2.1 Ponto final From c85d545dc6358bd51c7c48f0958e8e38f95586f6 Mon Sep 17 00:00:00 2001 From: Gabriel Prates Date: Tue, 15 Aug 2017 23:27:51 -0300 Subject: [PATCH 09/22] metacharacters' session finished --- README-pt_BR.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README-pt_BR.md b/README-pt_BR.md index 53448510..19a9dcf2 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -95,9 +95,7 @@ Os metacaracteres são os seguintes: ## 2.1 Ponto final -Ponto final `.` is the simplest example of meta character. The meta character `.` matches any single character. It will not match return -or newline characters. For example, the regular expression `.ar` means: any character, followed by the letter `a`, followed by the -letter `r`. +O ponto final `.` é um simples exemplo de metacaracteres. O metacaractere `.` corresponde à qualquer caractere sozinho. Ele não se iguala ao Enter e à quebra de linha. Por exemplo, a expressão regular `.ar` significa: qualquer caractere, seguido da letra `a`, seguida da letra `r`.
 ".ar" => The car parked in the garage.
@@ -107,9 +105,7 @@ letter `r`.
 
 ## 2.2 Conjunto de caracteres
 
-Character sets are also called character class. Square brackets are used to specify character sets. Use a hyphen inside a character set to
-specify the characters' range. The order of the character range inside square brackets doesn't matter. For example, the regular
-expression `[Tt]he` means: an uppercase `T` or lowercase `t`, followed by the letter `h`, followed by the letter `e`.
+Conjuntos de caracteres também são chamados de classes de caracteres. Utilizamos colchetes para especificar conjuntos de caracteres. Use um hífen dentro de um conjunto de caracteres para especificar o intervalo de caracteres. A ordem dos caracteres dentro dos colchetes não faz diferença. Por exemplo, a expressão regular `[Tt]he` significa: um caractere maiúsculo `T` ou minúsculo `t`, seguido da letra `h`, seguida da letra `e`.
 
 
 "[Tt]he" => The car parked in the garage.
@@ -117,7 +113,7 @@ expression `[Tt]he` means: an uppercase `T` or lowercase `t`, followed by the le
 
 [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.
+No entanto, um ponto final dentro de um conjunto de caracteres, significa apenas um ponto final. A expressão regular `ar[.]` significa: o caractere minúsculo `a`, seguido da letra `r`, seguida pelo caractere de ponto final `.`.
 
 
 "ar[.]" => A garage is a good place to park a car.
@@ -127,9 +123,7 @@ A period inside a character set, however, means a literal period. The regular ex
 
 ### 2.2.1 Conjunto de caracteres negados
 
-In general, the caret symbol represents the start of the string, but when it is typed after the opening square bracket it negates the
-character set. For example, the regular expression `[^c]ar` means: any character except `c`, followed by the character `a`, followed by
-the letter `r`.
+No geral, o símbolo do circunflexo representa o início da string, mas quando está logo após o colchete de abertura, ele faz a negação do conjunto de caracteres. Por exemplo, a expressão regular `[^c]ar` significa: qualquer caractere com exceção do `c`, seguido pelo caractere `a`, seguido da letra `r`.
 
 
 "[^c]ar" => The car parked in the garage.

From 99be7ef1774179ae817f8b9bfeb3457e80faf1a3 Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Wed, 16 Aug 2017 09:32:36 -0300
Subject: [PATCH 10/22] repetitions' session finished

---
 README-pt_BR.md | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 19a9dcf2..f3ac9066 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -133,25 +133,19 @@ No geral, o símbolo do circunflexo representa o início da string, mas quando e
 
 ## 2.3 Repetições
 
-Following meta characters `+`, `*` or `?` are used to specify how many times a subpattern can occur. These meta characters act
-differently in different situations.
+Seguindo os metacaracteres `+`, `*` ou `?` são utilizados para especificar quantas vezes um sub-padrão pode ocorrer. Esses metacaracteres atuam de formas diferentes em diferentes situações.
 
 ### 2.3.1 O Asterisco
 
-The symbol `*` matches zero or more repetitions of the preceding matcher. The regular expression `a*` means: zero or more repetitions
-of preceding lowercase character `a`. But if it appears after a character set or class then it finds the repetitions of the whole
-character set. For example, the regular expression `[a-z]*` means: any number of lowercase letters in a row.
+O símbolo `*` corresponde à zero ou mais repetições do padrão antecedente. A expressão regular `a*` significa: zero ou mais repetições do caractere minúsculo precedente `a`. Mas se o asterisco aparecer depois de um conjunto de caracteres, ou classe de caracteres, ele irá procurar as repetições de todo o conjunto. Por exemplo, a expressão regular `[a-z]*` significa: qualquer quantidade de letras minúsculas numa linha.
 
 
-"[a-z]*" => The car parked in the garage #21.
+"[a-z]*" => The car parked in the garage #21.
 
[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 -spaces, followed by lowercase character `c`, followed by lowercase character `a`, followed by lowercase character `t`, followed by -zero or more spaces. +O símbolo `*` pode ser usado junto do metacaractere `.` para encontrar qualquer string de caracteres `.*`. O símbolo `*` pode ser usado com o caractere de espaço em branco `\s` para encontrar uma string de caracteres em branco. Por exemplo, a expressão `\s*cat\s*` significa: zero ou mais espaços, seguidos do caractere minúsculo `c`, seguido do caractere minúsculo `a`, seguido do caractere minúsculo `t`, seguido de zero ou mais espaços.
 "\s*cat\s*" => The fat cat sat on the concatenation.
@@ -161,8 +155,7 @@ zero or more spaces.
 
 ### 2.3.2 O Sinal de Adição
 
-The symbol `+` matches one or more repetitions of the preceding character. For example, the regular expression `c.+t` means: lowercase
-letter `c`, followed by at least one character, followed by the lowercase character `t`.
+O símbolo `+` corresponde à uma ou mais repetições do caractere anterior. Por exemplo, a expressão regular `c.+t` significa: a letra minúscula `c`, seguida por pelo menos um caractere, seguido do caractere minúsculo `t`.
 
 
 "c.+t" => The fat cat sat on the mat.
@@ -172,9 +165,7 @@ letter `c`, followed by at least one character, followed by the lowercase charac
 
 ### 2.3.3 O Ponto de Interrogação
 
-In regular expression the meta character `?` makes the preceding character optional. This symbol matches zero or one instance of
-the preceding character. For example, the regular expression `[T]?he` means: Optional the uppercase letter `T`, followed by the lowercase
-character `h`, followed by the lowercase character `e`.
+Em expressões regulares, o metacaractere `?` faz o caractere anterior ser opcional. Esse símbolo corresponde à zero ou uma ocorrência do caractere anterior. Por exemplo, a expressão regular `[T]?he` significa: A letra maiúsculo `T` opcional, seguida do caractere minúsculo `h`, seguido do caractere minúsculo `e`.
 
 
 "[T]he" => The car is parked in the garage.

From a1233a956a9ce6d5122fb15eca9c86b340eb76c9 Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Thu, 17 Aug 2017 13:11:43 -0300
Subject: [PATCH 11/22] braces' session finished

---
 README-pt_BR.md | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index f3ac9066..77f2eefd 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -181,9 +181,7 @@ Em expressões regulares, o metacaractere `?` faz o caractere anterior ser opcio
 
 ## 2.4 Chaves
 
-In  regular expression braces that are also called quantifiers are used to specify the number of times that a
-character or a group of characters can be repeated. For example, the regular expression `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 (
-characters in the range of 0 to 9).
+Em expressões regulares, chaves, que também são chamadas de quantificadores, são utilizadas para especificar o número de vezes que o caractere, ou um grupo de caracteres, pode se repetir. Por exemplo, a expressão regular `[0-9]{2,3}` significa: Encontre no mínimo 2 dígitos, mas não mais que 3 (caracteres no intervalo de 0 à 9).
 
 
 "[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0.
@@ -191,8 +189,7 @@ characters in the range of 0 to 9).
 
 [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.
+Nós podemos retirar o segundo número. Por exemplo, a expressão regular `[0-9]{2,}` significa: Encontre 2 ou mais dígitos. Se removermos a vírgula a expressão regular `[0-9]{3}` significa: Encontre exatamente 3 dígitos.
 
 
 "[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0.

From 2af45f6ce05a44ab7b2e7faac0971a88e48e21e7 Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Thu, 17 Aug 2017 14:06:49 -0300
Subject: [PATCH 12/22] character group' session finished

---
 README-pt_BR.md | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 77f2eefd..fe948fc3 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -205,11 +205,7 @@ Nós podemos retirar o segundo número. Por exemplo, a expressão regular `[0-9]
 
 ## 2.5 Grupo de Caracteres
 
-Character group is a group of sub-patterns that is written inside Parentheses `(...)`. As we discussed before that in regular expression
-if we put a quantifier after a character then it will repeat the preceding character. But if we put quantifier after a character group then
-it repeats the whole character group. For example, the regular expression `(ab)*` matches zero or more repetitions of the character "ab".
-We can also use the alternation `|` meta character inside character group. For example, the regular expression `(c|g|p)ar` means: lowercase character `c`,
-`g` or `p`, followed by character `a`, followed by character `r`.
+Grupo de caracteres é um grupo de sub-padrão que é escrito dentro de parênteses `(...)`. Como falamos antes, se colocaramos um quantificador depois de um caractere, ele irá repetir o caractere anterior. Mas se colocarmos um quantificador depois de um grupo de caracteres, ele irá repetir todo o conjunto. Por exemplo, a expressão regular `(ab)*` corresponde à zero ou mais repetições dos caracteres "ab". Nós também podemos usar o metacaractere de alternância `|` dentro de um grupo de caracteres. Por exemplo, a expressão regular `(c|g|p)ar` significa: caractere minúsculo `c`, `g` ou `p`, seguido do caractere `a`, seguido do caractere `r`.
 
 
 "(c|g|p)ar" => The car is parked in the garage.

From 169039561d51448d643922aa638c496b3532a27f Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Thu, 17 Aug 2017 14:21:49 -0300
Subject: [PATCH 13/22] details

---
 README-pt_BR.md | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index fe948fc3..8dc65f57 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -6,6 +6,7 @@
 ## Traduções:
 
 * [English](README.md)
+* [Español](README-es.md)
 * [中文版](README-cn.md)
 * [日本語](README-ja.md)
 * [Português do Brasil](README-pt_BR.md)
@@ -53,7 +54,6 @@ 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)
-- [Bônus](#bônus)
 
 ## 1. Combinações Básicas
 
@@ -440,29 +440,6 @@ line. And because of `m` flag now regular expression engine matches pattern at t
 
 [Teste a RegExp](https://regex101.com/r/E88WE2/1)
 
-## Bônus
-
-* *Positive Integers*: `^\d+$`
-* *Negative Integers*: `^-\d+$`
-* *US Phone Number*: `^+?[\d\s]{3,}$`
-* *US Phone with code*: `^+?[\d\s]+(?[\d\s]{10,}$`
-* *Integers*: `^-?\d+$`
-* *Username*: `^[\w.]{4,16}$`
-* *Alpha-numeric characters*: `^[a-zA-Z0-9]*$`
-* *Alpha-numeric characters with spaces*: `^[a-zA-Z0-9 ]*$`
-* *Password*: `^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$`
-* *email*: `^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})*$`
-* *IPv4 address*: `^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$`
-* *Lowercase letters only*: `^([a-z])*$`
-* *Uppercase letters only*: `^([A-Z])*$`
-* *URL*: `^(((http|https|ftp):\/\/)?([[a-zA-Z0-9]\-\.])+(\.)([[a-zA-Z0-9]]){2,4}([[a-zA-Z0-9]\/+=%&_\.~?\-]*))*$`
-* *VISA credit card numbers*: `^(4[0-9]{12}(?:[0-9]{3})?)*$`
-* *Date (DD/MM/YYYY)*: `^(0?[1-9]|[12][0-9]|3[01])[- /.](0?[1-9]|1[012])[- /.](19|20)?[0-9]{2}$`
-* *Date (MM/DD/YYYY)*: `^(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}$`
-* *Date (YYYY/MM/DD)*: `^(19|20)?[0-9]{2}[- /.](0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])$`
-* *MasterCard credit card numbers*: `^(5[1-5][0-9]{14})*$`
-* *Hashtags*: Including hashtags with preceding text (abc123#xyz456) or containing white spaces within square brackets (#[foo bar]) : `\S*#(?:\[[^\]]+\]|\S+)`
-* *@mentions*: `\B@[a-z0-9_-]+`
 ## Contribution
 
 * Report issues

From 7a67f3cc788fad2c82791f97a7f69683d99a382a Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Fri, 18 Aug 2017 00:16:43 -0300
Subject: [PATCH 14/22] alternation' session finished

---
 README-pt_BR.md | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 8dc65f57..522d4d71 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -215,11 +215,7 @@ Grupo de caracteres é um grupo de sub-padrão que é escrito dentro de parênte
 
 ## 2.6 Alternância
 
-In regular expression Vertical bar `|` is used to define alternation. Alternation is like a condition between multiple expressions. Now,
-you may be thinking that character set and alternation works the same way. But the big difference between character set and alternation
-is that character set works on character level but alternation works on expression level. For example, the regular expression
-`(T|t)he|car` means: uppercase character `T` or lowercase `t`, followed by lowercase character `h`, followed by lowercase character `e`
-or lowercase character `c`, followed by lowercase character `a`, followed by lowercase character `r`.
+Em expressões regulares, a barra vertical `|` é usada para definir alternância. Alternância é como uma condição entre múltiplas expressões. Agora, você pode estar pensando que um conjunto de caracteres e a alternância funcionam da mesma forma. Mas a grande diferença entre eles é que o conjunto de caracteres trabalha no nível de caracteres, enquanto a alternância trabalha no nível das expressões. Por exemplo, a expressão regular `(T|t)he|car` significa: o caractere maiúsculo `T` ou minúsculo `t`, seguido do caractere minúsculo `h`, seguido do caractere minúsculo `e` ou o caractere minúsculo `c`, seguido do caractere minúsculo `a`, seguido do caractere minúsculo `r`.
 
 
 "(T|t)he|car" => The car is parked in the garage.

From 7432ef2d8d60905e53ef4da31a5ffe529658fd56 Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Fri, 18 Aug 2017 00:26:26 -0300
Subject: [PATCH 15/22] escaping special character' session finished

---
 README-pt_BR.md | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 522d4d71..a0a5c5f4 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -225,11 +225,7 @@ Em expressões regulares, a barra vertical `|` é usada para definir alternânci
 
 ## 2.7 Escapando Caracteres Especiais
 
-Backslash `\` is used in regular expression to escape the next character. This allows to to specify a symbol as a matching character
-including reserved characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching character prepend `\` before it.
-For example, the regular expression `.` is used to match any character except newline. Now to match `.` in an input string the regular
-expression `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by lowercase character `a`, followed by lowercase letter
-`t`, followed by optional `.` character.
+Em expressões regulares, a contrabarra `\` é usada para escapar o próximo caractere. Isso possibilita especificar um símbolo como um caractere correspondente, incluindo os caracteres reservados `{ } [ ] / \ + * . $ ^ | ?`. Para usar um caractere especial como um caractere correspondente, utilize `\` antes dele. Por exemplo, a expressão regular `.` é usada para encontrar qualquer caractere, exceto nova linha. Agora, para encontrar `.` em uma string de entrada, a expressão regular `(f|c|m)at\.?` significa: letra minúscula `f`, `c` ou `m`, seguida do caractere minúsculo `a`, seguido da letra minúscula `t`, seguida do caractere `.` opcional.
 
 
 "(f|c|m)at\.?" => The fat cat sat on the mat.

From a9ac4368615d920afac1470510bec212c75b362c Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Fri, 18 Aug 2017 00:38:30 -0300
Subject: [PATCH 16/22] shorthands' session finished

---
 README-pt_BR.md | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index a0a5c5f4..d4994e66 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -280,18 +280,17 @@ must be end of the string.
 
 ##  3. Forma Abreviada de Conjunto de Caracteres
 
-Regular expression provides shorthands for the commonly used character sets, which offer convenient shorthands for commonly used
-regular expressions. The shorthand character sets are as follows:
+As expressões regulares fornecem abreviações para conjuntos de caracteres comumente usados, que oferecem atalhos convenientes para expressões regulares comumente usadas. As abreviações são as seguintes:
 
-|Shorthand|Description|
+|Abreviação|Descrição|
 |:----:|----|
-|.|Any character except new line|
-|\w|Matches alphanumeric characters: `[a-zA-Z0-9_]`|
-|\W|Matches non-alphanumeric characters: `[^\w]`|
-|\d|Matches digit: `[0-9]`|
-|\D|Matches non-digit: `[^\d]`|
-|\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`|
-|\S|Matches non-whitespace character: `[^\s]`|
+|.|Qualquer caractere, exceto nova linha|
+|\w|Corresponde à caracteres alfanuméricos: `[a-zA-Z0-9_]`|
+|\W|Corresponde à caracteres não alfanuméricos: `[^\w]`|
+|\d|Corresponde à dígitos: `[0-9]`|
+|\D|Corresponde à não dígitos: `[^\d]`|
+|\s|Corresponde à caracteres de espaços em branco: `[\t\n\f\r\p{Z}]`|
+|\S|Corresponde à caracteres de espaços não em branco: `[^\s]`|
 
 ## 4. Olhar ao Redor
 

From 95162a45d8d69ad227157936dd474f6229ca1c2a Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Fri, 18 Aug 2017 13:15:36 -0300
Subject: [PATCH 17/22] anchors' session finished

---
 README-pt_BR.md | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index d4994e66..84103c05 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -235,18 +235,11 @@ Em expressões regulares, a contrabarra `\` é usada para escapar o próximo car
 
 ## 2.8 Âncoras
 
-In regular expressions, we use anchors to check if the matching symbol is the starting symbol or ending symbol of the
-input string. Âncoras are of two types: First type is Acento Circunflexo `^` that check if the matching character is the start
-character of the input and the second type is Sinal de Dólar `$` that checks if matching character is the last character of the
-input string.
+Em empressões regulares, usamos âncoras para verificar se o caractere encontrado está no início ou no final da string de entrada. As âncoras podem ser de dois tipos: O primeiro tipo é o Acento Circunflexo `^`, que verifica se o caractere encontrado está no início da string de entrada, e o segundo tipo é o Sinal de Dólar `$`, que verifica se o caractere encontrado é o último caractere da string.
 
 ### 2.8.1 Acento Circunflexo
 
-Acento Circunflexo `^` symbol is used to check if matching character is the first character of the input string. If we apply the following regular
-expression `^a` (if a is the starting symbol) to input string `abc` it matches `a`. But if we apply regular expression `^b` on above
-input string it does not match anything. Because in input string `abc` "b" is not the starting symbol. Let's take a look at another
-regular expression `^(T|t)he` which means: uppercase character `T` or lowercase character `t` is the start symbol of the input string,
-followed by lowercase character `h`, followed by lowercase character `e`.
+O símbolo do Acento Circunflexo `^` é usado para verificar se o caractere encontrado é o primeiro caractere da string de entrada. Se aplicarmos a seguinte expressão regular `^a` (se a é o primeiro caractere) à string de entrada `abc`, ela encontra o `a`. Mas se nós aplicarmos a expressão regular `^b` na mesma string, ela não encontrará nada. Isso acontece porque, na string `abc`, "b" não é o caractere inicial. Vamos dar uma olhada em outra expressão regular, `^(T|t)he` que significa: o caractere maiúsculo `T` ou o caractere minúsculo `t` que é o primeiro símbolo da string de entrada, seguido do caractere minúsculo `h`, seguido do caractere minúsculo `e`.
 
 
 "(T|t)he" => The car is parked in the garage.
@@ -262,9 +255,7 @@ followed by lowercase character `h`, followed by lowercase character `e`.
 
 ### 2.8.2 Sinal de Dólar
 
-Sinal de Dólar `$` symbol is used to check if matching character is the last character of the input string. For example, regular expression
-`(at\.)$` means: a lowercase character `a`, followed by lowercase character `t`, followed by a `.` character and the matcher
-must be end of the string.
+O símbolo do Sinal de Dólar `$` é usado para verificar se o caractere encontrado é o último caractere da string de entrada. Por exemplo, a expressão regular `(at\.)$` significa: um caractere minúsculo `a`, seguido do caractere minúsculo `t`, seguido de um ponto final `.` e o grupo deve estar no final da string.
 
 
 "(at\.)" => The fat cat. sat. on the mat.

From 3c0d094de7250d4fd4c4623146ce7803404efc7f Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Sun, 20 Aug 2017 15:28:07 -0300
Subject: [PATCH 18/22] license and contribution

---
 README-pt_BR.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 84103c05..d0056394 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -424,11 +424,11 @@ line. And because of `m` flag now regular expression engine matches pattern at t
 
 ## Contribution
 
-* Report issues
-* Open pull request with improvements
-* Spread the word
-* Reach out to me directly at ziishaned@gmail.com or [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned)
+* Reporte bugs
+* Abra pull request com melhorias
+* Espalhe a palavra
+* Me encontre diretamente em ziishaned@gmail.com ou [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned)
 
-## License
+## Licença
 
 MIT © [Zeeshan Ahmed](mailto:ziishaned@gmail.com)

From 058ba00c465c35ec6bddb4b513cab39337d9fa0a Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Sun, 20 Aug 2017 16:51:25 -0300
Subject: [PATCH 19/22] lookarounds' session finished

---
 README-pt_BR.md | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index d0056394..443427d3 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -285,13 +285,9 @@ As expressões regulares fornecem abreviações para conjuntos de caracteres com
 
 ## 4. Olhar ao Redor
 
-Lookbehind and lookahead sometimes known as lookaround are specific type of ***non-capturing group*** (Use to match the pattern but not
-included in matching list). Lookaheads are used when we have the condition that this pattern is preceded or followed by another certain
-pattern. For example, we want to get all numbers that are preceded by `$` character from the following input string `$4.44 and $10.88`.
-We will use following regular expression `(?<=\$)[0-9\.]*` which means: get all the numbers which contain `.` character and  are preceded
-by `$` character. Following are the lookarounds that are used in regular expressions:
+Lookbehind (olhar atrás) e lookahead (olhar à frente), às vezes conhecidos como lookarounds (olhar ao redor), são tipos específicos de ***grupo de não captura*** (utilizado para encontrar um padrão, mas não incluí-lo na lista de ocorrêncoas). Lookarounds são usados quando temos a condição de que determinado padrão seja precedido ou seguido de outro padrão. Por exemplo, queremos capturar todos os números precedidos do caractere `$` da seguinte string de entrada: `$4.44 and $10.88`. Vamos usar a seguinte expressão regular `(?<=\$)[0-9\.]*` que significa: procure todos os números que contêm o caractere `.` e são precedidos pelo caractere `$`. À seguir estão os lookarounds que são utilizados em expressões regulares:
 
-|Symbol|Description|
+|Símbolo|Descrição|
 |:----:|----|
 |?=|Lookahead Positivo|
 |?!|Lookahead Negativo|
@@ -300,12 +296,7 @@ by `$` character. Following are the lookarounds that are used in regular express
 
 ### 4.1 Lookahead Positivo
 
-The positive lookahead asserts that the first part of the expression must be followed by the lookahead expression. The returned match
-only contains the text that is matched by the first part of the expression. To define a positive lookahead, parentheses are used. Within
-those parentheses, a question mark with equal sign is used like this: `(?=...)`. Lookahead expression is written after the equal sign inside
-parentheses. For example, the regular expression `[T|t]he(?=\sfat)` means: optionally match lowercase letter `t` or uppercase letter `T`,
-followed by letter `h`, followed by letter `e`. In parentheses we define positive lookahead which tells regular expression engine to match
-`The` or `the` which are followed by the word `fat`.
+O lookahead positivo impõe que a primeira parte da expressão deve ser seguida pela expressão lookahead. A combinação retornada contém apenas o texto que encontrado pela primeira parte da expressão. Para definir um lookahead positivo, deve-se usar parênteses. Dentro desses parênteses, é usado um ponto de interrogação seguido de um sinal de igual, dessa forma: `(?=...)`. Expressões lookahead são escritas depois do sinal de igual dentro do parênteses. Por exemplo, a expressão regular `[T|t]he(?=\sfat)` significa: encontre a letra minúscula `t` ou a letra maiúscula `T`, seguida da letra `h`, seguida da letra `e`. Entre parênteses, nós definimos o lookahead positivo que diz para o motor de expressões regulares para encontrar `The` ou `the` que são seguidos pela palavra `fat`.
 
 
 "[T|t]he(?=\sfat)" => The fat cat sat on the mat.
@@ -315,10 +306,7 @@ followed by letter `h`, followed by letter `e`. In parentheses we define positiv
 
 ### 4.2 Lookahead Negativo
 
-Negative lookahead is used when we need to get all matches from input string that are not followed by a pattern. Negative lookahead
-defined same as we define positive lookahead but the only difference is instead of equal `=` character we use negation `!` character
-i.e. `(?!...)`. Let's take a look at the following regular expression `[T|t]he(?!\sfat)` which means: get all `The` or `the` words from
-input string that are not followed by the word `fat` precedes by a space character.
+O lookahead negativo é usado quando nós precisamos encontrar todas as ocorrências da string de entrada que não são seguidas por um determinado padrão. O lookahead negativo é definido da mesma forma que definimos o lookahead positivo, mas a única diferença é que, no lugar do sinal de igual `=`, usamos o caractere de negação `!`, ex.: `(?!...)`. Vamos dar uma olhada na seguinte expressão regular `[T|t]he(?!\sfat)`, que significa: obtenha as palavras `The` ou `the` da string de entrada que não são seguidas pela palavra `fat`, precedida de um caractere de espaço.
 
 
 "[T|t]he(?!\sfat)" => The fat cat sat on the mat.
@@ -328,9 +316,7 @@ input string that are not followed by the word `fat` precedes by a space charact
 
 ### 4.3 Lookbehind Positivo
 
-Positive lookbehind is used to get all the matches that are preceded by a specific pattern. Positive lookbehind is denoted by
-`(?<=...)`. For example, the regular expression `(?<=[T|t]he\s)(fat|mat)` means: get all `fat` or `mat` words from input string that
-are after the word `The` or `the`.
+Lookbehind positivo é usado para encontrar todas as ocorrências que são precedidas por um padrão específico. O lookbehind positivo é indicado por `(?<=...)`. Por exemplo, a expressão regular `(?<=[T|t]he\s)(fat|mat)` significa: obtenha todas as palavras `fat` ou `mat` da string de entrada, que estão depois das palavras `The` ou `the`.
 
 
 "(?<=[T|t]he\s)(fat|mat)" => The fat cat sat on the mat.
@@ -340,9 +326,7 @@ are after the word `The` or `the`.
 
 ### 4.4 Lookbehind Negativo
 
-Negative lookbehind is used to get all the matches that are not preceded by a specific pattern. Negative lookbehind is denoted by
-`(?
 "(?<![T|t]he\s)(cat)" => The cat sat on cat.

From 611b4dfb3bdcaf79543ffb9442dffaa904d48e1c Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Sun, 20 Aug 2017 16:57:29 -0300
Subject: [PATCH 20/22] readme details

---
 README-pt_BR.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 443427d3..361086b1 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -7,9 +7,11 @@
 
 * [English](README.md)
 * [Español](README-es.md)
+* [Français](README-fr.md)
+* [Português do Brasil](README-pt_BR.md)
 * [中文版](README-cn.md)
 * [日本語](README-ja.md)
-* [Português do Brasil](README-pt_BR.md)
+* [한국어](README-ko.md)
 
 ## O que é uma Expressão Regular?
 

From 500806866a9a6d73e9bbc41185d646d6737a573e Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Mon, 21 Aug 2017 00:18:51 -0300
Subject: [PATCH 21/22] lookarounds' session finished

---
 README-pt_BR.md | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 361086b1..9637f683 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -338,21 +338,17 @@ Lookbehind negativo é usado para encontrar todas as ocorrências que não são
 
 ## 5. Flags
 
-Flags (sinalizadores) are also called modifiers because they modify the output of a regular expression. These flags can be used in any order or
-combination, and are an integral part of the RegExp.
+Flags (sinalizadores) também são chamados de modificadores, porque eles modificam o resultado da expressão regular. Essas flags podem ser usadas em qualquer ordem ou combinação, e são uma parte integrante da RegExp.
 
-|Flag|Description|
+|Flag|Descrição|
 |:----:|----|
-|i|Case insensitive: Sets matching to be case-insensitive.|
-|g|Global Search: Search for a pattern throughout the input string.|
-|m|Multilinhas: Anchor meta character works on each line.|
+|i|Case insensitive: Define que o padrão será case-insensitive.|
+|g|Busca global: Procura o padrão em toda a string de entrada.|
+|m|Multilinhas: Os metacaracteres de âncora funcionam em cada linha.|
 
 ### 5.1 Indiferente à Maiúsculas
 
-The `i` modifier is used to perform case-insensitive matching. For example, the regular expression `/The/gi` means: uppercase letter
-`T`, followed by lowercase character `h`, followed by character `e`. And at the end of regular expression the `i` flag tells the
-regular expression engine to ignore the case. As you can see we also provided `g` flag because we want to search for the pattern in
-the whole input string.
+O modificador `i` é usado para tornar o padrão case-insensitive. Por exemplo, a expressão regular `/The/gi` significa: a letra maiúscula `T`, seguida do caractere minúsculo `h`, seguido do caractere `e`. E ao final da expressão regular, a flag `i` diz ao motor de expressões regulares para ignorar maiúsculas e minúsculas. Como você pode ver, nós também determinamos a flag `g` porque queremos procurar o padrão em toda a string de entrada.
 
 
 "The" => The fat cat sat on the mat.
@@ -368,10 +364,7 @@ the whole input string.
 
 ### 5.2 Busca Global
 
-The `g` modifier is used to perform a global match (find all matches rather than stopping after the first match). For example, the
-regular expression`/.(at)/g` means: any character except new line, followed by lowercase character `a`, followed by lowercase
-character `t`. Because we provided `g` flag at the end of the regular expression now it will find every matches from whole input
-string.
+O modificador `g` é usado para realizar uma busca global (encontrar todas as ocorrências sem parar na primeira encontrada). Por exemplo, a expressão regular `/.(at)/g` significa: qualquer caractere, exceto nova linha, seguido do caractere minúsculo `a`, seguido do caractere minúsculo `t`. Por causa da flag `g` no final da expressão regular, agora ela vai encontrar todas as ocorrências em toda a string de entrada.
 
 
 "/.(at)/" => The fat cat sat on the mat.
@@ -387,10 +380,7 @@ string.
 
 ### 5.3 Multilinhas
 
-The `m` modifier is used to perform a multi-line match. As we discussed earlier anchors `(^, $)` are used to check if pattern is
-the beginning of the input or end of the input string. But if we want that anchors works on each line we use `m` flag. For example, the
-regular expression `/at(.)?$/gm` means: lowercase character `a`, followed by lowercase character `t`, optionally anything except new
-line. And because of `m` flag now regular expression engine matches pattern at the end of each line in a string.
+O modificador `m` é usado para realizar uma busca em várias linhas. Como falamos antes, as âncoras `(^, $)` são usadas para verificar se o padrão está no início ou no final da string de entrada. Mas se queremos que as âncoras funcionem em cada uma das linhas, usamos a flag `m`. Por exemplo, a expressão regular `/at(.)?$/gm` significa: o caractere minúsculo `a`, seguido do caractere minúsculo `t`, opcionalmente seguido por qualquer caractere, exceto nova linha. E por causa da flag `m`, agora o motor de expressões regulares encontra o padrão no final de cada uma das linhas da string.
 
 
 "/.at(.)?$/" => The fat

From 5f787c1876bbc7e9240febbfcd5165445d128863 Mon Sep 17 00:00:00 2001
From: Gabriel Prates 
Date: Mon, 21 Aug 2017 00:40:25 -0300
Subject: [PATCH 22/22] update image link

---
 README-pt_BR.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README-pt_BR.md b/README-pt_BR.md
index 9637f683..4f1e1d8b 100644
--- a/README-pt_BR.md
+++ b/README-pt_BR.md
@@ -23,7 +23,7 @@ Imagine que você está escrevendo uma aplicação e quer colocar regras para qu
 
 

-Regular expression +Regular expression

A expressão regular acima aceita as strings `john_doe`, `jo-hn_doe` e `john12_as`. Ela não aceita `Jo` porque essa string contém letras maiúsculas e também é muito curta.