diff options
author | Florian Dieminger <me@fiji-flo.de> | 2021-02-11 18:29:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 18:29:51 +0100 |
commit | 2bc5610921312613f8623f7ed347aa576689b2b6 (patch) | |
tree | f17a7a00e232c97d1335ff3cb24dbcfafacfe141 /files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html | |
parent | 964decad361766e85d928a56f0ab80af0e75c172 (diff) | |
parent | fc56124ac4eda6b3f0349c8a16fa750f27b4c7d6 (diff) | |
download | translated-content-2bc5610921312613f8623f7ed347aa576689b2b6.tar.gz translated-content-2bc5610921312613f8623f7ed347aa576689b2b6.tar.bz2 translated-content-2bc5610921312613f8623f7ed347aa576689b2b6.zip |
Merge pull request #32 from fiji-flo/unslugging-zh-cn
Unslugging zh cn
Diffstat (limited to 'files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html')
-rw-r--r-- | files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html b/files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html new file mode 100644 index 0000000000..740b32604b --- /dev/null +++ b/files/zh-cn/conflicting/web/javascript/reference/global_objects/regexp/index.html @@ -0,0 +1,154 @@ +--- +title: RegExp.prototype +slug: conflicting/Web/JavaScript/Reference/Global_Objects/RegExp +tags: + - JavaScript + - Property + - RegExp +translation_of: Web/JavaScript/Reference/Global_Objects/RegExp +translation_of_original: Web/JavaScript/Reference/Global_Objects/RegExp/prototype +original_slug: Web/JavaScript/Reference/Global_Objects/RegExp/prototype +--- +<p>{{JSRef("Global_Objects", "RegExp")}}</p> +<h2 id="Summary" name="Summary">概述</h2> +<p><font face="Courier New, Andale Mono, monospace">RegExp.prototype 属性表示 </font><span style="line-height: 1.5;">{{jsxref("Global_Objects/RegExp", "RegExp")}} </span><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: 1.5;">构造函数的原型对象。</span></p> +<h2 id="Description" name="Description">描述</h2> +<p>查看<font face="Courier New, Andale Mono, monospace"> </font><span style="line-height: 1.5;">{{jsxref("Global_Objects/RegExp", "RegExp")}} </span><span style="line-height: 1.5;">了解更多关于 </span><code style="font-style: normal; line-height: 1.5;">RegExp</code> <code style="font-style: normal; line-height: 1.5;">实例的说明。</code></p> +<p><code>RegExp</code> 实例继承 <code>RegExp.prototype</code>。修改该原型对象上的属性或方法会影响到所有的 <code>RegExp</code> <code>实例。</code></p> +<h2 id="Properties" name="Properties">属性</h2> +<p>查看<a href="/zh-CN/docs/JavaScript/Reference/Deprecated_Features#RegExp_Properties" title="zh-CN/docs/JavaScript/Reference/Deprecated_Features#RegExp_Properties">已废弃的RegExp属性</a></p> +<p>注意,<code>RegExp</code> 对象的几个属性既有完整的长属性名,也有对应的类 Perl 的短属性名。两个属性都有着同样的值。JavaScript 的正则语法就是基于 Perl 的。</p> +<dl> + <dt> + <code style="font-style: normal; font-weight: bold;">RegExp.prototype.</code><code style="font-style: normal; font-weight: bold;">constructor</code></dt> + <dd> + 创建该正则对象的构造函数。</dd> + <dt> + {{jsxref("RegExp.prototype.global")}}</dt> + <dd> + 是否开启全局匹配,也就是匹配目标字符串中所有可能的匹配项,而不是只进行第一次匹配。</dd> + <dt> + {{jsxref("RegExp.prototype.ignoreCase")}}</dt> + <dd> + 在匹配字符串时是否要忽略字符的大小写。</dd> + <dt> + {{jsxref("RegExp.prototype.lastIndex")}}</dt> + <dd> + 下次匹配开始的字符串索引位置。</dd> + <dt> + {{jsxref("RegExp.prototype.multiline")}}</dt> + <dd> + 是否开启多行模式匹配(影响 ^ 和 $ 的行为)。</dd> + <dt> + {{jsxref("RegExp.prototype.source")}}</dt> + <dd> + 正则对象的源模式文本。</dd> + <dt> + {{jsxref("RegExp.prototype.sticky")}} {{experimental_inline}}</dt> + <dd> + 是否开启粘滞匹配。</dd> +</dl> +<div> + {{ jsOverrides("Object", "properties", "constructor", "global", "ignoreCase", "lastIndex", "multiline", "source", "sticky") }}</div> +<h2 id="Methods" name="Methods">方法</h2> +<p>查看<a href="/zh-CN/docs/JavaScript/Reference/Deprecated_Features#RegExp_Methods" title="zh-CN/docs/JavaScript/Reference/Deprecated_Features#RegExp_Methods">已废弃的RegExp方法</a></p> +<dl> + <dt> + {{jsxref("RegExp.prototype.exec()")}}</dt> + <dd> + 在目标字符串中执行一次正则匹配操作。</dd> + <dt> + {{jsxref("RegExp.prototype.test()")}}</dt> + <dd> + 测试当前正则是否能匹配目标字符串。</dd> + <dt> + {{jsxref("RegExp.prototype.toSource()")}} {{non-standard_inline}}</dt> + <dd> + 返回一个字符串,其值为该正则对象的字面量形式。覆盖了<code>Object.prototype.toSource</code> 方法.</dd> + <dt> + {{jsxref("RegExp.prototype.toString()")}}</dt> + <dd> + 返回一个字符串,其值为该正则对象的字面量形式。覆盖了{{jsxref("Object.prototype.toString()")}} 方法。</dd> +</dl> +<div> + {{ jsOverrides("Object", "Methods", "exec", "test", "toSource", "toString") }}</div> +<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>ECMAScript 1st Edition. Implemented in JavaScript 1.1</td> + <td>Standard</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('ES5.1', '#sec-15.10.5.1', 'RegExp')}}</td> + <td>{{Spec2('ES5.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-regexp.prototype', 'RegExp.prototype')}}</td> + <td>{{Spec2('ES6')}}</td> + <td> </td> + </tr> + </tbody> +</table> +<h2 id="浏览器兼容性" style="margin-bottom: 20px; line-height: 30px;">浏览器兼容性</h2> +<p>{{ CompatibilityTable() }}</p> +<div id="compat-desktop"> + <table class="compat-table"> + <tbody> + <tr> + <th style="line-height: 16px;">Feature</th> + <th style="line-height: 16px;">Chrome</th> + <th style="line-height: 16px;">Firefox (Gecko)</th> + <th style="line-height: 16px;">Internet Explorer</th> + <th style="line-height: 16px;">Opera</th> + <th style="line-height: 16px;">Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<div id="compat-mobile"> + <table class="compat-table"> + <tbody> + <tr> + <th style="line-height: 16px;">Feature</th> + <th style="line-height: 16px;">Android</th> + <th style="line-height: 16px;">Chrome for Android</th> + <th style="line-height: 16px;">Firefox Mobile (Gecko)</th> + <th style="line-height: 16px;">IE Mobile</th> + <th style="line-height: 16px;">Opera Mobile</th> + <th style="line-height: 16px;">Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + <td>{{ CompatVersionUnknown() }}</td> + </tr> + </tbody> + </table> +</div> +<h2 id="相关链接" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions" title="JavaScript/Guide/Regular_Expressions">Regular Expressions</a> chapter in the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide" title="JavaScript/Guide">JavaScript Guide</a></li> + <li>{{jsxref("Global_Objects/RegExp", "RegExp")}}</li> + <li>{{jsxref("Function.prototype")}}</li> +</ul> +<p> </p> |