aboutsummaryrefslogtreecommitdiff
path: root/regex/struct.Captures.html
diff options
context:
space:
mode:
Diffstat (limited to 'regex/struct.Captures.html')
-rw-r--r--regex/struct.Captures.html156
1 files changed, 156 insertions, 0 deletions
diff --git a/regex/struct.Captures.html b/regex/struct.Captures.html
new file mode 100644
index 0000000..aab73fd
--- /dev/null
+++ b/regex/struct.Captures.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="generator" content="rustdoc">
+ <meta name="description" content="API documentation for the Rust `Captures` struct in crate `regex`.">
+ <meta name="keywords" content="rust, rustlang, rust-lang, Captures">
+
+ <title>regex::Captures - Rust</title>
+
+ <link rel="stylesheet" type="text/css" href="../main.css">
+
+ <link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
+
+</head>
+<body class="rustdoc">
+ <!--[if lte IE 8]>
+ <div class="warning">
+ This old browser is unsupported and will most likely display funky
+ things.
+ </div>
+ <![endif]-->
+
+
+
+ <section class="sidebar">
+ <a href='../regex/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a>
+ <p class='location'><a href='index.html'>regex</a></p><script>window.sidebarCurrent = {name: 'Captures', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
+ </section>
+
+ <nav class="sub">
+ <form class="search-form js-only">
+ <div class="search-container">
+ <input class="search-input" name="search"
+ autocomplete="off"
+ placeholder="Click or press 'S' to search, '?' for more options..."
+ type="search">
+ </div>
+ </form>
+ </nav>
+
+ <section id='main' class="content struct">
+<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>regex</a>::<wbr><a class='struct' href=''>Captures</a></span><span class='out-of-band'><span id='render-detail'>
+ <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
+ [<span class='inner'>&#x2212;</span>]
+ </a>
+ </span><a id='src-8829' class='srclink' href='../src/regex/re.rs.html#803-807' title='goto source code'>[src]</a></span></h1>
+<pre class='rust struct'>pub struct Captures&lt;'t&gt; {
+ // some fields omitted
+}</pre><div class='docblock'><p>Captures represents a group of captured strings for a single match.</p>
+
+<p>The 0th capture always corresponds to the entire match. Each subsequent
+index corresponds to the next capture group in the regex.
+If a capture group is named, then the matched string is <em>also</em> available
+via the <code>name</code> method. (Note that the 0th capture is always unnamed and so
+must be accessed with the <code>at</code> method.)</p>
+
+<p>Positions returned from a capture group are always byte indices.</p>
+
+<p><code>&#39;t</code> is the lifetime of the matched text.</p>
+</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl&lt;'t&gt; <a class='struct' href='../regex/struct.Captures.html' title='regex::Captures'>Captures</a>&lt;'t&gt;</code></h3><div class='impl-items'><h4 id='method.pos' class='method'><code>fn <a href='#method.pos' class='fnname'>pos</a>(&amp;self, i: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a href='http://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(<a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>)</a>&gt;</code></h4>
+<div class='docblock'><p>Returns the start and end positions of the Nth capture group.
+Returns <code>None</code> if <code>i</code> is not a valid capture group or if the capture
+group did not match anything.
+The positions returned are <em>always</em> byte indices with respect to the
+original string matched.</p>
+</div><h4 id='method.at' class='method'><code>fn <a href='#method.at' class='fnname'>at</a>(&amp;self, i: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;'t <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
+<div class='docblock'><p>Returns the matched string for the capture group <code>i</code>. If <code>i</code> isn&#39;t
+a valid capture group or didn&#39;t match anything, then <code>None</code> is
+returned.</p>
+</div><h4 id='method.name' class='method'><code>fn <a href='#method.name' class='fnname'>name</a>(&amp;self, name: &amp;<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;'t <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;</code></h4>
+<div class='docblock'><p>Returns the matched string for the capture group named <code>name</code>. If
+<code>name</code> isn&#39;t a valid capture group or didn&#39;t match anything, then
+<code>None</code> is returned.</p>
+</div><h4 id='method.iter' class='method'><code>fn <a href='#method.iter' class='fnname'>iter</a>(&amp;'t self) -&gt; <a class='struct' href='../regex/struct.SubCaptures.html' title='regex::SubCaptures'>SubCaptures</a>&lt;'t&gt;</code></h4>
+<div class='docblock'><p>Creates an iterator of all the capture groups in order of appearance
+in the regular expression.</p>
+</div><h4 id='method.iter_pos' class='method'><code>fn <a href='#method.iter_pos' class='fnname'>iter_pos</a>(&amp;'t self) -&gt; <a class='struct' href='../regex/struct.SubCapturesPos.html' title='regex::SubCapturesPos'>SubCapturesPos</a>&lt;'t&gt;</code></h4>
+<div class='docblock'><p>Creates an iterator of all the capture group positions in order of
+appearance in the regular expression. Positions are byte indices
+in terms of the original string matched.</p>
+</div><h4 id='method.iter_named' class='method'><code>fn <a href='#method.iter_named' class='fnname'>iter_named</a>(&amp;'t self) -&gt; <a class='struct' href='../regex/struct.SubCapturesNamed.html' title='regex::SubCapturesNamed'>SubCapturesNamed</a>&lt;'t&gt;</code></h4>
+<div class='docblock'><p>Creates an iterator of all named groups as an tuple with the group
+name and the value. The iterator returns these values in arbitrary
+order.</p>
+</div><h4 id='method.expand' class='method'><code>fn <a href='#method.expand' class='fnname'>expand</a>(&amp;self, text: &amp;<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -&gt; <a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code></h4>
+<div class='docblock'><p>Expands all instances of <code>$name</code> in <code>text</code> to the corresponding capture
+group <code>name</code>.</p>
+
+<p><code>name</code> may be an integer corresponding to the index of the
+capture group (counted by order of opening parenthesis where <code>0</code> is the
+entire match) or it can be a name (consisting of letters, digits or
+underscores) corresponding to a named capture group.</p>
+
+<p>If <code>name</code> isn&#39;t a valid capture group (whether the name doesn&#39;t exist or
+isn&#39;t a valid index), then it is replaced with the empty string.</p>
+
+<p>To write a literal <code>$</code> use <code>$$</code>.</p>
+</div><h4 id='method.len' class='method'><code>fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
+<div class='docblock'><p>Returns the number of captured groups.</p>
+</div><h4 id='method.is_empty' class='method'><code>fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
+<div class='docblock'><p>Returns true if and only if there are no captured groups.</p>
+</div></div></section>
+ <section id='search' class="content hidden"></section>
+
+ <section class="footer"></section>
+
+ <div id="help" class="hidden">
+ <div class="shortcuts">
+ <h1>Keyboard shortcuts</h1>
+ <dl>
+ <dt>?</dt>
+ <dd>Show this help dialog</dd>
+ <dt>S</dt>
+ <dd>Focus the search field</dd>
+ <dt>&larrb;</dt>
+ <dd>Move up in search results</dd>
+ <dt>&rarrb;</dt>
+ <dd>Move down in search results</dd>
+ <dt>&#9166;</dt>
+ <dd>Go to active search result</dd>
+ </dl>
+ </div>
+ <div class="infos">
+ <h1>Search tricks</h1>
+ <p>
+ Prefix searches with a type followed by a colon (e.g.
+ <code>fn:</code>) to restrict the search to a given type.
+ </p>
+ <p>
+ Accepted types are: <code>fn</code>, <code>mod</code>,
+ <code>struct</code>, <code>enum</code>,
+ <code>trait</code>, <code>typedef</code> (or
+ <code>tdef</code>).
+ </p>
+ <p>
+ Search functions by type signature (e.g.
+ <code>vec -> usize</code>)
+ </p>
+ </div>
+ </div>
+
+
+
+ <script>
+ window.rootPath = "../";
+ window.currentCrate = "regex";
+ window.playgroundUrl = "";
+ </script>
+ <script src="../jquery.js"></script>
+ <script src="../main.js"></script>
+
+ <script async src="../search-index.js"></script>
+</body>
+</html> \ No newline at end of file