You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A word boundary `pattern:\b`is a test, just like`pattern:^`and`pattern:$`.
3
+
Uma borda de palavra `pattern:\b`é um teste, como o`pattern:^`e`pattern:$` também são.
4
4
5
-
When the regexp engine (program module that implements searching for regexps) comes across`pattern:\b`, it checks that the position in the string is a word boundary.
5
+
Quando o interpretador de regex (um módulo de programa que implementa a busca por expressões regulares) encontra um`pattern:\b`, ele verifica se naquela posição da string ocorre a borda de uma palavra.
6
6
7
-
There are three different positions that qualify as word boundaries:
7
+
Existem três diferentes posições que configuram uma borda de palavra:
8
8
9
-
-At string start, if the first string character is a word character`pattern:\w`.
10
-
-Between two characters in the string, where one is a word character `pattern:\w`and the other is not.
11
-
-At string end, if the last string character is a word character`pattern:\w`.
9
+
-O início de uma string, se o primeiro carácter da string é um carácter de palavra`pattern:\w`.
10
+
-Entre dois caracteres de uma string, quando um deles é um carácter de palavra `pattern:\w`e o outro não.
11
+
-No fim da string, Se o último carácter for um carácter de palavra`pattern:\w`.
12
12
13
-
For instance, regexp `pattern:\bJava\b`will be found in `subject:Hello, Java!`, where `subject:Java`is a standalone word, but not in`subject:Hello, JavaScript!`.
13
+
Por exemplo, a regex `pattern:\bJava\b`casa com `subject:Hello, Java!`, já que `subject:Java`é uma palavra solta, mas não casa com`subject:Hello, JavaScript!`.
In the string `subject:Hello, Java!`following positions correspond to`pattern:\b`:
20
+
Na string `subject:Hello, Java!`as seguintes posições casam com`pattern:\b`:
21
21
22
22

23
23
24
-
So, it matches the pattern`pattern:\bHello\b`, because:
24
+
Ela casa com o padrão`pattern:\bHello\b` por que:
25
25
26
-
1.At the beginning of the string matches the first test`pattern:\b`.
27
-
2.Then matches the word`pattern:Hello`.
28
-
3.Then the test `pattern:\b`matches again, as we're between `subject:o`and a comma.
26
+
1.Casa o começo da string com o primeiro teste`pattern:\b`.
27
+
2.Depois casa com a palavra`pattern:Hello`.
28
+
3.E então casa com o teste `pattern:\b`novamente, dado que estamos entre um `subject:o`e uma vírgula.
29
29
30
-
So the pattern`pattern:\bHello\b`would match, but not `pattern:\bHell\b` (because there's no word boundary after `l`) and not `Java!\b` (because the exclamation sign is not a wordly character`pattern:\w`, so there's no word boundary after it).
30
+
Então o padrão`pattern:\bHello\b`casaria, mas não o `pattern:\bHell\b` (porque não temos nenhuma borda de palavra após o `l`), e nem o `Java!\b` (porque a exclamação não é um carácter de palavra`pattern:\w`, então não tem uma borda de palavra após ela).
alert( "Hello, Java!".match(/\bJava!\b/) ); // null (no match)
37
37
```
38
38
39
-
We can use `pattern:\b`not only with words, but with digits as well.
39
+
Além de usar o `pattern:\b`com palavras, podemos usá-lo com dígitos também.
40
40
41
-
For example, the pattern `pattern:\b\d\d\b`looks for standalone 2-digit numbers. In other words, it looks for 2-digit numbers that are surrounded by characters different from `pattern:\w`, such as spaces or punctuation (or text start/end).
41
+
O padrão `pattern:\b\d\d\b`procura por números soltos de dois dígitos. Em outras palavras, ele procura por números de dois dígitos delimitados por caracteres diferentes da classe `pattern:\w`, como espaços e pontuação (ou início e final da string)
```warn header="Word boundary `pattern:\b`doesn't work for non-latin alphabets"
49
-
The word boundary test `pattern:\b`checks that there should be`pattern:\w`on the one side from the position and "not`pattern:\w`" - on the other side.
48
+
```warn header="A borda de palavra `pattern:\b`não funciona com alfabetos não-latinos"
49
+
O teste de borda de palavra `pattern:\b`verifica que existe um carácter`pattern:\w`de um lado da posição e um "não`pattern:\w`" do outro
50
50
51
-
But `pattern:\w`means a latin letter `a-z` (or a digit or an underscore), so the test doesn't work for other characters, e.g. cyrillic letters or hieroglyphs.
51
+
Mas o `pattern:\w`representa uma letra do alfabeto latino `a-z` (ou dígito, ou underscore '_'), então o teste não funciona para outros alfabetos, como o cirílico ou sinogramas, por exemplo.
0 commit comments