fix: update guide hint to properly declare regex (#34625)
This commit is contained in:
@@ -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`都会匹配相同的东西。
|
||||
@@ -58,4 +58,4 @@ let repeatNum = "42 42 42";
|
||||
let reRegex = /^(\d+)\s\1\s\1$/;
|
||||
let result = reRegex.test(repeatNum);
|
||||
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user