语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -5,20 +5,20 @@
</div></div>
<p><strong>lastParen </strong>非标准属性是正则表达式的静态和只读属性,包含匹配到的最后一个子串(如果存在)。<code>RegExp.$+</code>是这一属性的别名。</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox"><var>RegExp</var>.lastParen
<pre><code class="language-javascript"><var>RegExp</var>.lastParen
RegExp['$+']
</pre>
</code></pre>
<h2 id="描述">描述</h2>
<p><code>lastParen</code> 属性是静态的,不是正则表达式独立对象的属性。反之,你应始终将其使用为 <code>RegExp.lastParen</code> 或者 <code>RegExp['$+']</code></p>
<p><code>lastParen</code> 属性的值是只读的,并且会在匹配成功时修改。</p>
<p>你不能使用属性访问器(<code>RegExp.$+</code>)来使用简写的别名,因为解析器在这里会将 "+" 看做表达式,并抛出 <a href="Reference/Global_Objects/SyntaxError" title="SyntaxError 对象代表尝试解析语法上不合法的代码的错误。"><code>SyntaxError</code></a> 。使用 <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors">方括号符号</a>来访问属性。</p>
<h2 id="示例">示例</h2>
<h3 id="使用_lastParen_和">使用 <code>lastParen</code><code>$+</code></h3>
<pre class="brush: js">var re = /(hi)/g;
<pre><code class="language-javascript">var re = /(hi)/g;
re.test('hi there!');
RegExp.lastParen; // "hi"
RegExp['$+']; // "hi"
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<p>非标准。并不是任何现行规范的一部分。</p>
<h2 id="浏览器兼容性">浏览器兼容性</h2>