Skip to content

Commit

Permalink
Deploying to gh-pages from @ d3dd5c8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 30, 2024
1 parent 4652a43 commit e9a59b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@
});
let sdoMap = JSON.parse(`{}`);
let biblio = JSON.parse(`{"refsByClause":{"sec-regexp.escape":["_ref_0"]},"entries":[{"type":"clause","id":"sec-regexp.escape","title":"RegExp.escape ( S )","titleHTML":"RegExp.escape ( <var>S</var> )","number":"22.2.5.2"},{"type":"op","aoid":"EncodeForRegExpEscape","refId":"sec-encode"},{"type":"clause","id":"sec-encode","title":"EncodeForRegExpEscape ( c )","titleHTML":"EncodeForRegExpEscape ( <var>c</var> )","number":"22.2.5.3","referencingIds":["_ref_0"]},{"type":"clause","id":"sec-properties-of-the-regexp-constructor","titleHTML":"Properties of the RegExp Constructor","number":"22.2.5"},{"type":"clause","id":"sec-regexp-regular-expression-objects","titleHTML":"RegExp (Regular Expression) Objects","number":"22.2"},{"type":"clause","id":"sec-text-processing","titleHTML":"Text Processing","number":"22"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright &amp; Software License","number":"A"}]}`);
let biblio = JSON.parse(`{"refsByClause":{"sec-regexp.escape":["_ref_0"]},"entries":[{"type":"clause","id":"sec-regexp.escape","title":"RegExp.escape ( S )","titleHTML":"RegExp.escape ( <var>S</var> )","number":"22.2.5.2"},{"type":"op","aoid":"EncodeForRegExpEscape","refId":"sec-encodeforregexpescape"},{"type":"clause","id":"sec-encodeforregexpescape","title":"EncodeForRegExpEscape ( c )","titleHTML":"EncodeForRegExpEscape ( <var>c</var> )","number":"22.2.5.3","referencingIds":["_ref_0"]},{"type":"clause","id":"sec-properties-of-the-regexp-constructor","titleHTML":"Properties of the RegExp Constructor","number":"22.2.5"},{"type":"clause","id":"sec-regexp-regular-expression-objects","titleHTML":"RegExp (Regular Expression) Objects","number":"22.2"},{"type":"clause","id":"sec-text-processing","titleHTML":"Text Processing","number":"22"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright &amp; Software License","number":"A"}]}`);
;let usesMultipage = false</script><style>/* IBM Plex fonts (Latin subset) have been downloaded from Google Fonts and modified to add support back in for the `zero` substitution (slashed zeroes) */
/* https://fonts.googleapis.com/css2?family=IBM%20Plex%20Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap */
Expand Down Expand Up @@ -3243,7 +3243,7 @@
</ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120" width="54" height="54">
<title>Menu</title>
<path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins<button class="unpin-all">clear</button></div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-text-processing" title="Text Processing"><span class="secnum">22</span> Text Processing</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-regexp-regular-expression-objects" title="RegExp (Regular Expression) Objects"><span class="secnum">22.2</span> RegExp (Regular Expression) Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-regexp-constructor" title="Properties of the RegExp Constructor"><span class="secnum">22.2.5</span> Properties of the RegExp Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-regexp.escape" title="RegExp.escape ( S )"><span class="secnum">22.2.5.2</span> RegExp.escape ( <var>S</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-encode" title="EncodeForRegExpEscape ( c )"><span class="secnum">22.2.5.3</span> EncodeForRegExpEscape ( <var>c</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / July 29, 2024</h1><h1 class="title">RegExp.escape</h1>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins<button class="unpin-all">clear</button></div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-text-processing" title="Text Processing"><span class="secnum">22</span> Text Processing</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-regexp-regular-expression-objects" title="RegExp (Regular Expression) Objects"><span class="secnum">22.2</span> RegExp (Regular Expression) Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-regexp-constructor" title="Properties of the RegExp Constructor"><span class="secnum">22.2.5</span> Properties of the RegExp Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-regexp.escape" title="RegExp.escape ( S )"><span class="secnum">22.2.5.2</span> RegExp.escape ( <var>S</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-encodeforregexpescape" title="EncodeForRegExpEscape ( c )"><span class="secnum">22.2.5.3</span> EncodeForRegExpEscape ( <var>c</var> )</a></li></ol></li></ol></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / July 30, 2024</h1><h1 class="title">RegExp.escape</h1>
<emu-clause id="sec-text-processing" number="22">
<h1><span class="secnum">22</span> Text Processing</h1>
Expand All @@ -3260,14 +3260,14 @@ <h1><span class="secnum">22.2.5.2</span> RegExp.escape ( <var>S</var> )</h1>
<p>This function returns a copy of <var>S</var> in which characters that are potentially special in a regular expression <emu-nt><a href="https://tc39.es/ecma262/#prod-Pattern">Pattern</a></emu-nt> have been replaced by equivalent escape sequences.</p>
<p>It performs the following steps when called:</p>
<emu-alg><ol><li>If <var>S</var> <emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, throw a TypeError exception.</li><li>Let <var>escaped</var> be the empty String.</li><li>Let <var>cpList</var> be <emu-xref aoid="StringToCodePoints"><a href="https://tc39.es/ecma262/#sec-stringtocodepoints">StringToCodePoints</a></emu-xref>(<var>S</var>).</li><li>For each code point <var>c</var> in <var>cpList</var>, do<ol><li>If <var>escaped</var> is the empty String, and <var>c</var> is matched by <emu-nt><a href="https://tc39.es/ecma262/#prod-DecimalDigit">DecimalDigit</a></emu-nt> or <emu-nt><a href="https://tc39.es/ecma262/#prod-AsciiLetter">AsciiLetter</a></emu-nt>, then<ol><li>NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a <code>\0</code> character escape or a <emu-nt><a href="https://tc39.es/ecma262/#prod-DecimalEscape">DecimalEscape</a></emu-nt> such as <code>\1</code> and still match <var>S</var> rather than be interpreted as an extension of the preceding escape sequence. Escaping a leading ASCII letter does the same for the context after <code>\c</code>.</li><li>Let <var>numericValue</var> be the numeric value of <var>c</var>.</li><li>Let <var>hex</var> be <emu-xref aoid="Number::toString"><a href="https://tc39.es/ecma262/#sec-numeric-types-number-tostring">Number::toString</a></emu-xref>(<emu-xref aoid="𝔽"><a href="https://tc39.es/ecma262/#𝔽">𝔽</a></emu-xref>(<var>numericValue</var>), 16).</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: The length of <var>hex</var> is 2.</li><li>Set <var>escaped</var> to the <emu-xref href="#string-concatenation"><a href="https://tc39.es/ecma262/#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x005C (REVERSE SOLIDUS), <emu-val>"x"</emu-val>, and <var>hex</var>.</li></ol></li><li>Else,<ol><li>Set <var>escaped</var> to the <emu-xref href="#string-concatenation"><a href="https://tc39.es/ecma262/#string-concatenation">string-concatenation</a></emu-xref> of <var>escaped</var> and <emu-xref aoid="EncodeForRegExpEscape" id="_ref_0"><a href="#sec-encode">EncodeForRegExpEscape</a></emu-xref>(<var>c</var>).</li></ol></li></ol></li><li>Return <var>escaped</var>.</li></ol></emu-alg>
<emu-alg><ol><li>If <var>S</var> <emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">is not a String</a></emu-xref>, throw a TypeError exception.</li><li>Let <var>escaped</var> be the empty String.</li><li>Let <var>cpList</var> be <emu-xref aoid="StringToCodePoints"><a href="https://tc39.es/ecma262/#sec-stringtocodepoints">StringToCodePoints</a></emu-xref>(<var>S</var>).</li><li>For each code point <var>c</var> in <var>cpList</var>, do<ol><li>If <var>escaped</var> is the empty String, and <var>c</var> is matched by <emu-nt><a href="https://tc39.es/ecma262/#prod-DecimalDigit">DecimalDigit</a></emu-nt> or <emu-nt><a href="https://tc39.es/ecma262/#prod-AsciiLetter">AsciiLetter</a></emu-nt>, then<ol><li>NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a <code>\0</code> character escape or a <emu-nt><a href="https://tc39.es/ecma262/#prod-DecimalEscape">DecimalEscape</a></emu-nt> such as <code>\1</code> and still match <var>S</var> rather than be interpreted as an extension of the preceding escape sequence. Escaping a leading ASCII letter does the same for the context after <code>\c</code>.</li><li>Let <var>numericValue</var> be the numeric value of <var>c</var>.</li><li>Let <var>hex</var> be <emu-xref aoid="Number::toString"><a href="https://tc39.es/ecma262/#sec-numeric-types-number-tostring">Number::toString</a></emu-xref>(<emu-xref aoid="𝔽"><a href="https://tc39.es/ecma262/#𝔽">𝔽</a></emu-xref>(<var>numericValue</var>), 16).</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: The length of <var>hex</var> is 2.</li><li>Set <var>escaped</var> to the <emu-xref href="#string-concatenation"><a href="https://tc39.es/ecma262/#string-concatenation">string-concatenation</a></emu-xref> of the code unit 0x005C (REVERSE SOLIDUS), <emu-val>"x"</emu-val>, and <var>hex</var>.</li></ol></li><li>Else,<ol><li>Set <var>escaped</var> to the <emu-xref href="#string-concatenation"><a href="https://tc39.es/ecma262/#string-concatenation">string-concatenation</a></emu-xref> of <var>escaped</var> and <emu-xref aoid="EncodeForRegExpEscape" id="_ref_0"><a href="#sec-encodeforregexpescape">EncodeForRegExpEscape</a></emu-xref>(<var>c</var>).</li></ol></li></ol></li><li>Return <var>escaped</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>Despite having similar names, <emu-xref aoid="EscapeRegExpPattern"><a href="https://tc39.es/ecma262/#sec-escaperegexppattern">EscapeRegExpPattern</a></emu-xref> and <code>RegExp.escape</code> do not perform similar actions. The former escapes a pattern for representation as a string, while this function escapes a string for representation inside a pattern.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-encode" type="abstract operation" aoid="EncodeForRegExpEscape">
<emu-clause id="sec-encodeforregexpescape" type="abstract operation" aoid="EncodeForRegExpEscape">
<h1><span class="secnum">22.2.5.3</span> EncodeForRegExpEscape ( <var>c</var> )</h1>
<p>The abstract operation EncodeForRegExpEscape takes argument <var>c</var> (a code point) and returns a String. It returns a string representing a <emu-nt><a href="https://tc39.es/ecma262/#prod-Pattern">Pattern</a></emu-nt> for matching <var>c</var>. If <var>c</var> is white space or an ASCII punctuator, the returned value is an escape sequence. Otherwise, the returned value is a string representation of <var>c</var> itself. It performs the following steps when called:</p>
Expand Down

0 comments on commit e9a59b6

Please sign in to comment.