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

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

@@ -1,18 +1,18 @@
<article id="wikiArticle">
<div></div>
<h2 id="信息">信息</h2>
<pre class="syntaxbox">SyntaxError: invalid regular expression flag "x" (Firefox)
<pre><code class="language-javascript">SyntaxError: invalid regular expression flag "x" (Firefox)
SyntaxError: Invalid regular expression flags (Chrome)
</pre>
</code></pre>
<h2 id="错误类型">错误类型</h2>
<p><a href="Reference/Global_Objects/SyntaxError" title="SyntaxError 对象代表尝试解析语法上不合法的代码的错误。"><code>语法错误</code></a>.</p>
<h2 id="什么地方出错了">什么地方出错了?</h2>
<p>在代码中出现了无效的正则表达式的标记。在一个正则表达式字面量中,由闭合的两条斜线组成一个模式,(正则表达式的)标记定义在第二个(斜线)标记之后。他们也可以通过<a href="Reference/RegExp" title="此页面仍未被本地化, 期待您的翻译!"><code>正则表达式</code></a> 对象的构造函数第二个参数来定义。正则表达式的标记可以单独或者任意次序的组合使用但ECMAScript只规定了五个。</p>
<p>要使正则表达式包含标记,使用此语法:</p>
<pre class="brush: js">var re = /pattern/flags;
</pre>
<pre><code class="language-javascript">var re = /pattern/flags;
</code></pre>
<p></p>
<pre class="brush: js">var re = new RegExp('pattern', 'flags');</pre>
<pre><code class="language-javascript">var re = new RegExp('pattern', 'flags');</code></pre>
<table class="standard-table">
<caption>正则表达式标记</caption>
<thead>
@@ -46,27 +46,27 @@ SyntaxError: Invalid regular expression flags (Chrome)
</table>
<h2 id="示例">示例</h2>
<p>只有5个有效的正则表达式标记。</p>
<pre class="brush: js example-bad">/foo/bar;
<pre><code class="language-js example-bad">/foo/bar;
// SyntaxError: invalid regular expression flag "b"
</pre>
</code></pre>
<p>你打算创建一个正则表达式吗?一个包含两条斜线的表达式被解释为一个正则表达式的字面量。</p>
<pre class="brush: js example-bad">let obj = {
<pre><code class="language-js example-bad">let obj = {
url: /docs/Web
};
// SyntaxError: invalid regular expression flag "W"
</pre>
</code></pre>
<p>还是你想创建一个字符串呢?添加单引号或双引号创建一个字符串字面量。</p>
<pre class="brush: js example-good">let obj = {
<pre><code class="language-js example-good">let obj = {
url: '/docs/Web'
};</pre>
};</code></pre>
<h3 id="有效的正则表达式标记">有效的正则表达式标记</h3>
<p>在JavaScript中允许的五个有效的正则表达式标记参阅上表。</p>
<pre class="brush: js example-good">/foo/g;
<pre><code class="language-js example-good">/foo/g;
/foo/gim;
/foo/uy;
</pre>
</code></pre>
<h2 id="相关页面">相关页面</h2>
<ul>
<li><a href="https://developer.mozilla.orgGuide/Regular_Expressions">正则表达式</a></li>