|
@@ -2541,7 +2541,7 @@ while ((match = tagRE.exec(text))) {
|
|
|
match = ['{{name}}', 'name']
|
|
|
```
|
|
|
|
|
|
-但 `match` 并不是一个普通的数组,它还包含 `match.index` 属性,该属性的值代表着匹配的字符串在整个字符串中的位置,假设我们有这样一段文本:`'abc{{name}}'`,则匹配成功后 `match.index` 的值为 `3`,因为第一个做花括号(`{`)在整个字符串中的索引是 `3`。明白了这些我们就可以继续看 `while` 循环内的代码了,在 `while` 循环内的开头是如下这段代码:
|
|
|
+但 `match` 并不是一个普通的数组,它还包含 `match.index` 属性,该属性的值代表着匹配的字符串在整个字符串中的位置,假设我们有这样一段文本:`'abc{{name}}'`,则匹配成功后 `match.index` 的值为 `3`,因为第一个左花括号(`{`)在整个字符串中的索引是 `3`。明白了这些我们就可以继续看 `while` 循环内的代码了,在 `while` 循环内的开头是如下这段代码:
|
|
|
|
|
|
```js
|
|
|
index = match.index
|