fix: update guide hint to properly declare regex (#34625)

This commit is contained in:
Fred Battle
2018-12-12 15:48:22 -08:00
committed by Jingyi Ding
parent da6972338f
commit cb2f76e1b2
6 changed files with 18 additions and 18 deletions

View File

@@ -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);
```
```