diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex/index.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex/index.html b/files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex/index.html index 92dadc8159..ddfe60c595 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/regexp/lastindex/index.html @@ -10,13 +10,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex --- <div> {{JSRef("Global_Objects", "RegExp")}}</div> -<h2 id="Summary" name="Summary">概述</h2> +<h2 id="Summary">概述</h2> <p><code><strong>lastIndex</strong></code> 是正则表达式的一个可读可写的整型属性,用来指定下一次匹配的起始索引。</p> <div> {{js_property_attributes(1,0,0)}}</div> <h2 id="语法">语法</h2> <pre class="syntaxbox language-html"><var>lastIndex</var> = <var>regExpObj</var>.lastIndex;</pre> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>只有正则表达式使用了表示全局检索的 "<code>g</code>" 标志时,该属性才会起作用。此时应用下面的规则:</p> <ul> <li>如果 <code>lastIndex</code> 大于字符串的长度,则 <code>regexp.test</code> 和 <code>regexp.exec</code> 将会匹配失败,然后 <code>lastIndex</code> 被设置为 0。</li> @@ -111,7 +111,7 @@ console.log(re.lastIndex);</pre> </tbody> </table> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <ul> <li>{{jsxref("RegExp.prototype.ignoreCase")}}</li> <li>{{jsxref("RegExp.prototype.global")}}</li> |