From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/regexp/multiline/index.html | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 files/zh-cn/web/javascript/reference/global_objects/regexp/multiline/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/regexp/multiline') diff --git a/files/zh-cn/web/javascript/reference/global_objects/regexp/multiline/index.html b/files/zh-cn/web/javascript/reference/global_objects/regexp/multiline/index.html new file mode 100644 index 0000000000..8f9a9adbd6 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/regexp/multiline/index.html @@ -0,0 +1,108 @@ +--- +title: RegExp.prototype.multiline +slug: Web/JavaScript/Reference/Global_Objects/RegExp/multiline +tags: + - JavaScript + - Property + - Prototype + - RegExp + - Regular Expressions +translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/multiline +--- +
+ {{JSRef("Global_Objects", "RegExp")}}
+

概述

+

multiline 属性表明正则表达式是否使用了 "m" 标志。multiline 是正则表达式实例的一个只读属性。

+
+ {{js_property_attributes(0,0,0)}}
+

描述

+

multiline 是一个布尔对象,如果使用了 "m" 标志,则返回 true;否则,返回 false。"m" 标志意味着一个多行输入字符串被看作多行。例如,使用 "m","^" 和 "$" 将会从只匹配正则字符串的开头或结尾,变为匹配字符串中任一行的开头或结尾。

+

你无法直接更改此属性。

+

示例

+

例子:使用 multiline

+
var regex = new RegExp("foo", "m")
+
+console.log(regex.multiline) // true
+
+

规范

+ + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
ECMAScript 3rd Edition. Implemented in JavaScript 1.2.StandardInitial definition.
+ JavaScript 1.5: multiline is a property of a RegExp instance, not the RegExp object.
{{SpecName('ES5.1', '#sec-15.10.7.4', 'RegExp.prototype.multiline')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-get-regexp.prototype.multiline', 'RegExp.prototype.multiline')}}{{Spec2('ES6')}}multiline is now a prototype accessor property rather than an instance's own data property.
+

浏览器兼容性

+

{{ CompatibilityTable() }}

+
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+

相关链接

+ -- cgit v1.2.3-54-g00ecf