fix: update guide hint to properly declare regex (#34625)
This commit is contained in:
@ -17,8 +17,8 @@ localeTitle: إعادة استخدام الأنماط باستخدام مجمو
|
||||
|
||||
إذا كنا سنترجم التعبير المعتاد حرفياً ، فسيبدو شيئًا كالتالي:
|
||||
|
||||
`let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
`let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
`
|
||||
|
||||
كل من `rea` و `literalRe` تطابق نفس الشيء.
|
||||
|
@ -19,8 +19,8 @@ let testString = "test test test ";
|
||||
如果我们要正面翻译正则表达式,它看起来像这样:
|
||||
|
||||
```js
|
||||
let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
```
|
||||
|
||||
`rea`和`literalRe`都会匹配相同的东西。
|
||||
|
@ -12,11 +12,11 @@ let result = reRegex.test(testString);
|
||||
```
|
||||
`result` will match only `test test` because `\1` in this example stands for the same text as most recently matched by the 1st capturing group `(test)`.
|
||||
|
||||
If we were to lierally translate the regex, it would look something like this:
|
||||
If we were to literally translate the regex, it would look something like this:
|
||||
|
||||
```js
|
||||
let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
```
|
||||
Both `rea` and `literalRe` would match the same thing.
|
||||
|
||||
|
@ -19,8 +19,8 @@ let testString = "test test test ";
|
||||
Se fôssemos traduzir literalmente o regex, seria algo como isto:
|
||||
|
||||
```js
|
||||
let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
```
|
||||
|
||||
Ambos `rea` e `literalRe` combinariam com a mesma coisa.
|
||||
|
@ -19,8 +19,8 @@ let testString = "test test test ";
|
||||
Если бы мы должны были перевести регулярное выражение, это выглядело бы примерно так:
|
||||
|
||||
```js
|
||||
let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
```
|
||||
|
||||
И `rea` и `literalRe` будут соответствовать одному и тому же.
|
||||
|
@ -19,8 +19,8 @@ let testString = "test test test ";
|
||||
Si tuviéramos que traducir literalmente la expresión regular, se vería algo así:
|
||||
|
||||
```js
|
||||
let re = /(test)\s\1;
|
||||
let literalRe = /test\stest;
|
||||
let re = /(test)\s\1/;
|
||||
let literalRe = /test\stest/;
|
||||
```
|
||||
|
||||
Tanto `rea` como `literalRe` coincidirían con la misma cosa.
|
||||
|
Reference in New Issue
Block a user