Skip to content

Duplicate id attributes #1590

@BurdetteLamar

Description

@BurdetteLamar

In the doc for Regexp, there are duplicate values for attribute id; attribute id="class-regexp-method-match" appears in two different h2 elements:

<span id="class-Regexp-label-Method+match" class="legacy-anchor"></span>
<h2 id="class-regexp-method-match"><a href="[#class-regexp-method-match](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#class-regexp-method-match)">Method <code>match</code></a></h2>

<p>Each of the methods <a href="[Regexp.html#method-i-match](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#method-i-match)"><code>Regexp#match</code></a>, <a href="[String.html#method-i-match](view-source:https://docs.ruby-lang.org/en/master/String.html#method-i-match)"><code>String#match</code></a>, and <a href="[Symbol.html#method-i-match](view-source:https://docs.ruby-lang.org/en/master/Symbol.html#method-i-match)"><code>Symbol#match</code></a> returns a <a href="[MatchData.html](view-source:https://docs.ruby-lang.org/en/master/MatchData.html)"><code>MatchData</code></a> object if a match was found, <code>nil</code> otherwise; each also sets <a href="[Regexp.html#class-regexp-global-variables](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#class-regexp-global-variables)">global variables</a>:</p>

<pre class="ruby"><span class="ruby-string">&#39;food&#39;</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/foo/</span>) <span class="ruby-comment"># =&gt; #&lt;MatchData &quot;foo&quot;&gt;</span>
<span class="ruby-string">&#39;food&#39;</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/bar/</span>) <span class="ruby-comment"># =&gt; nil</span>
</pre>

<span id="class-Regexp-label-Operator+-3D~" class="legacy-anchor"></span>
<h2 id="class-regexp-operator-"><a href="[#class-regexp-operator-](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#class-regexp-operator-)">Operator <code>=~</code></a></h2>

<p>Each of the operators <a href="[Regexp.html#method-i-3D~](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#method-i-3D~)"><code>Regexp#=~</code></a>, <a href="[String.html#method-i-3D~](view-source:https://docs.ruby-lang.org/en/master/String.html#method-i-3D~)"><code>String#=~</code></a>, and <a href="[Symbol.html#method-i-3D~](view-source:https://docs.ruby-lang.org/en/master/Symbol.html#method-i-3D~)"><code>Symbol#=~</code></a> returns an integer offset if a match was found, <code>nil</code> otherwise; each also sets <a href="[Regexp.html#class-regexp-global-variables](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#class-regexp-global-variables)">global variables</a>:</p>

<pre class="ruby"><span class="ruby-regexp">/bar/</span> <span class="ruby-operator">=~</span> <span class="ruby-string">&#39;foo bar&#39;</span> <span class="ruby-comment"># =&gt; 4</span>
<span class="ruby-string">&#39;foo bar&#39;</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/bar/</span> <span class="ruby-comment"># =&gt; 4</span>
<span class="ruby-regexp">/baz/</span> <span class="ruby-operator">=~</span> <span class="ruby-string">&#39;foo bar&#39;</span> <span class="ruby-comment"># =&gt; nil</span>
</pre>

<span id="class-Regexp-label-Method+match-3F" class="legacy-anchor"></span>
<h2 id="class-regexp-method-match"><a href="[#class-regexp-method-match](view-source:https://docs.ruby-lang.org/en/master/Regexp.html#class-regexp-method-match)">Method <code>match?</code></a></h2>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions