From c40612041809fe289aba58aefa170bbe784aba1f Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove name attribute for zh-CN --- .../reference/global_objects/string/match/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/match') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html index f369a7a7f9..57bd74a182 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html @@ -10,11 +10,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
{{EmbedInteractiveExample("pages/js/string-match.html", "shorter")}}
-

语法

+

语法

str.match(regexp)
-

参数

+

参数

regexp
@@ -42,11 +42,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
一个{{jsxref("Array")}},其内容取决于global(g)标志的存在与否,如果未找到匹配则为{{jsxref("null")}}。
-

描述

+

描述

如果正则表达式不包含 标志,str.match() 将返回与 {{jsxref("RegExp.prototype.exec()", "RegExp.exec()")}}. 相同的结果。

-

参看:RegExp 方法

+

参看:RegExp 方法

-

示例

+

示例

-

例子:使用 match

+

例子:使用 match

在下例中,使用 match 查找 "Chapter" 紧跟着 1 个或多个数值字符,再紧跟着一个小数点和数值字符 0 次或多次。正则表达式包含 i 标志,因此大小写会被忽略。

@@ -78,7 +78,7 @@ console.log(found); // 'index' 属性(22) 是整个匹配从零开始的索引。 // 'input' 属性是被解析的原始字符串。 -

例子:match 使用全局(global)和忽略大小写(ignore case)标志

+

例子:match 使用全局(global)和忽略大小写(ignore case)标志

下例展示了 match 使用 global 和 ignore case 标志。A-E、a-e 的所有字母将会作为一个数组的元素返回。

@@ -204,7 +204,7 @@ str3.match(null); // 返回["null"]
  • 从 Gecko 49 {{geckoRelease(49)}} 开始 , 不再支持非标准的标志参数 ({{bug(1108382)}}).
  • -

    相关链接

    +

    相关链接