<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>Capture Groups
</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="Composable F# regular expressions."/>
    <meta name="author" content="Jack Fox"/>

    <script src="https://code.jquery.com/jquery-1.8.0.js"></script>
    <script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
    <script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>

    <link type="text/css" rel="stylesheet" href="/FsRegEx/content/style.css" />
    <script type="text/javascript" src="/FsRegEx/content/tips.js"></script>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">
      <div class="masthead">
        <ul class="nav nav-pills pull-right">
          <li><a href="http://fsharp.org">fsharp.org</a></li>
          <li><a href="https://github.com/jackfoxy/FsRegEx">github page</a></li>
        </ul>
        <h3 class="muted"><a href="/FsRegEx/index.html">FsRegEx</a></h3>
      </div>
      <hr />
      <div class="row">
        <div class="span9" id="main">
          
<h1><a name="Capture-Groups" class="anchor" href="#Capture-Groups">Capture Groups</a></h1>
<h2><a name="FsGroup" class="anchor" href="#FsGroup">FsGroup</a></h2>
<p><code>FsGroup</code> provides the functionality in the <code>System.Text.RegularExpressions.Group</code> Class, but returning arrays of objects instead of special collections and makes the group name a property.</p>
<h3><a name="anonymous-groups" class="anchor" href="#anonymous-groups">anonymous groups</a></h3>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="id">pattern</span> <span class="o">=</span> <span class="s">@&quot;(\b(\w+?)[,:;]?\s?)+[?.!]&quot;</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">input</span> <span class="o">=</span> <span class="s">&quot;This is one sentence. This is a second sentence.&quot;</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">m</span> <span class="o">=</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">firstMatch</span> <span onmouseout="hideTip(event, 'fs1', 4)" onmouseover="showTip(event, 'fs1', 4)" class="id">pattern</span> <span onmouseout="hideTip(event, 'fs2', 5)" onmouseover="showTip(event, 'fs2', 5)" class="id">input</span>
<span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="fn">printfn</span> <span class="s">&quot;Match: </span><span class="pf">%s</span><span class="s">&quot;</span> <span onmouseout="hideTip(event, 'fs3', 7)" onmouseover="showTip(event, 'fs3', 7)" class="id">m</span><span class="pn">.</span><span class="id">Value</span>

<span onmouseout="hideTip(event, 'fs3', 8)" onmouseover="showTip(event, 'fs3', 8)" class="id">m</span><span class="pn">.</span><span class="id">Groups</span><span class="pn">(</span><span class="pn">)</span>
<span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs5', 9)" onmouseover="showTip(event, 'fs5', 9)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs6', 10)" onmouseover="showTip(event, 'fs6', 10)" class="id">iteri</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs7', 11)" onmouseover="showTip(event, 'fs7', 11)" class="id">i</span> <span onmouseout="hideTip(event, 'fs8', 12)" onmouseover="showTip(event, 'fs8', 12)" class="id">g</span> <span class="k">-&gt;</span> 
    <span onmouseout="hideTip(event, 'fs4', 13)" onmouseover="showTip(event, 'fs4', 13)" class="fn">printfn</span> <span class="s">&quot;   Group </span><span class="pf">%i</span><span class="s">: &#39;</span><span class="pf">%s</span><span class="s">&#39;&quot;</span> <span onmouseout="hideTip(event, 'fs7', 14)" onmouseover="showTip(event, 'fs7', 14)" class="id">i</span> <span onmouseout="hideTip(event, 'fs8', 15)" onmouseover="showTip(event, 'fs8', 15)" class="id">g</span><span class="pn">.</span><span class="id">Value</span>
    <span onmouseout="hideTip(event, 'fs8', 16)" onmouseover="showTip(event, 'fs8', 16)" class="id">g</span><span class="pn">.</span><span class="id">Captures</span><span class="pn">(</span><span class="pn">)</span>
    <span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs5', 17)" onmouseover="showTip(event, 'fs5', 17)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs6', 18)" onmouseover="showTip(event, 'fs6', 18)" class="id">iteri</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs7', 19)" onmouseover="showTip(event, 'fs7', 19)" class="id">i</span> <span onmouseout="hideTip(event, 'fs9', 20)" onmouseover="showTip(event, 'fs9', 20)" class="id">c</span> <span class="k">-&gt;</span>  
        <span onmouseout="hideTip(event, 'fs4', 21)" onmouseover="showTip(event, 'fs4', 21)" class="fn">printfn</span> <span class="s">&quot;      Capture </span><span class="pf">%i</span><span class="s">: &#39;</span><span class="pf">%s</span><span class="s">&#39;&quot;</span> <span onmouseout="hideTip(event, 'fs7', 22)" onmouseover="showTip(event, 'fs7', 22)" class="id">i</span> <span onmouseout="hideTip(event, 'fs9', 23)" onmouseover="showTip(event, 'fs9', 23)" class="id">c</span><span class="pn">.</span><span class="id">Value</span> 
        <span class="pn">)</span>
    <span class="pn">)</span>

<span class="c">// Match: This is one sentence.</span>
<span class="c">//    Group 0: &#39;This is one sentence.&#39;</span>
<span class="c">//        Capture 0: &#39;This is one sentence.&#39;</span>
<span class="c">//    Group 1: &#39;sentence&#39;</span>
<span class="c">//        Capture 0: &#39;This &#39;</span>
<span class="c">//        Capture 1: &#39;is &#39;</span>
<span class="c">//        Capture 2: &#39;one &#39;</span>
<span class="c">//        Capture 3: &#39;sentence&#39;</span>
<span class="c">//    Group 2: &#39;sentence&#39;</span>
<span class="c">//        Capture 0: &#39;This&#39;</span>
<span class="c">//        Capture 1: &#39;is&#39;</span>
<span class="c">//        Capture 2: &#39;one&#39;</span>
<span class="c">//        Capture 3: &#39;sentence&#39;</span>
</code></pre></td>
</tr>
</table>
<h3><a name="named-groups" class="anchor" href="#named-groups">named groups</a></h3>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs10', 24)" onmouseover="showTip(event, 'fs10', 24)" class="id">pattern&#39;</span> <span class="o">=</span> <span class="s">@&quot;\b(?&lt;FirstWord&gt;\w+)\s?((\w+)\s)*(?&lt;LastWord&gt;\w+)?(?&lt;Punctuation&gt;\p{Po})&quot;</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs11', 25)" onmouseover="showTip(event, 'fs11', 25)" class="id">input&#39;</span> <span class="o">=</span> <span class="s">&quot;The cow jumped over the moon.&quot;</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs12', 26)" onmouseover="showTip(event, 'fs12', 26)" class="id">m&#39;</span> <span class="o">=</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">firstMatch</span> <span onmouseout="hideTip(event, 'fs10', 27)" onmouseover="showTip(event, 'fs10', 27)" class="id">pattern&#39;</span> <span onmouseout="hideTip(event, 'fs11', 28)" onmouseover="showTip(event, 'fs11', 28)" class="id">input&#39;</span>

<span onmouseout="hideTip(event, 'fs4', 29)" onmouseover="showTip(event, 'fs4', 29)" class="fn">printfn</span> <span class="s">&quot;Named Groups:&quot;</span>

<span onmouseout="hideTip(event, 'fs12', 30)" onmouseover="showTip(event, 'fs12', 30)" class="id">m&#39;</span><span class="pn">.</span><span class="id">Groups</span><span class="pn">(</span><span class="pn">)</span>
<span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs5', 31)" onmouseover="showTip(event, 'fs5', 31)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 32)" onmouseover="showTip(event, 'fs13', 32)" class="id">iter</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs8', 33)" onmouseover="showTip(event, 'fs8', 33)" class="id">g</span> <span class="k">-&gt;</span> <span onmouseout="hideTip(event, 'fs4', 34)" onmouseover="showTip(event, 'fs4', 34)" class="fn">printfn</span> <span class="s">&quot;   </span><span class="pf">%s</span><span class="s">: &#39;</span><span class="pf">%s</span><span class="s">&#39;&quot;</span> <span onmouseout="hideTip(event, 'fs8', 35)" onmouseover="showTip(event, 'fs8', 35)" class="id">g</span><span class="pn">.</span><span class="id">Name</span> <span onmouseout="hideTip(event, 'fs8', 36)" onmouseover="showTip(event, 'fs8', 36)" class="id">g</span><span class="pn">.</span><span class="id">Value</span><span class="pn">)</span>

<span class="c">// Named Groups:</span>
<span class="c">//    0: &#39;The cow jumped over the moon.&#39;</span>
<span class="c">//    1: &#39;the &#39;</span>
<span class="c">//    2: &#39;the&#39;</span>
<span class="c">//    FirstWord: &#39;The&#39;</span>
<span class="c">//    LastWord: &#39;moon&#39;</span>
<span class="c">//    Punctuation: &#39;.&#39;</span>
</code></pre></td>
</tr>
</table>
<h3><a name="capturing-groups" class="anchor" href="#capturing-groups">capturing groups</a></h3>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs14', 37)" onmouseover="showTip(event, 'fs14', 37)" class="id">regExpr</span> <span class="o">=</span> <span class="s">@&quot;\b(\w+?)([\u00AE\u2122])&quot;</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs15', 38)" onmouseover="showTip(event, 'fs15', 38)" class="id">matches</span> <span class="o">=</span> 
    <span class="s">&quot;Microsoft&#174; Office Professional Edition combines several office &quot;</span> <span class="o">+</span>
        <span class="s">&quot;productivity products, including Word, Excel&#174;, Access&#174;, Outlook&#174;, &quot;</span> <span class="o">+</span>
        <span class="s">&quot;PowerPoint&#174;, and several others. Some guidelines for creating &quot;</span> <span class="o">+</span>
        <span class="s">&quot;corporate documents using these productivity tools are available &quot;</span> <span class="o">+</span>
        <span class="s">&quot;from the documents created using Silverlight™ on the corporate &quot;</span> <span class="o">+</span>
        <span class="s">&quot;intranet site.&quot;</span>
    <span class="o">|&gt;</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">matches</span> <span onmouseout="hideTip(event, 'fs14', 39)" onmouseover="showTip(event, 'fs14', 39)" class="id">regExpr</span>

<span onmouseout="hideTip(event, 'fs15', 40)" onmouseover="showTip(event, 'fs15', 40)" class="id">matches</span>
<span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs5', 41)" onmouseover="showTip(event, 'fs5', 41)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 42)" onmouseover="showTip(event, 'fs13', 42)" class="id">iter</span> <span class="pn">(</span><span class="k">fun</span> <span onmouseout="hideTip(event, 'fs3', 43)" onmouseover="showTip(event, 'fs3', 43)" class="id">m</span> <span class="k">-&gt;</span>
    <span class="k">let</span> <span onmouseout="hideTip(event, 'fs16', 44)" onmouseover="showTip(event, 'fs16', 44)" class="id">groups</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 45)" onmouseover="showTip(event, 'fs3', 45)" class="id">m</span><span class="pn">.</span><span class="id">Groups</span><span class="pn">(</span><span class="pn">)</span>
    <span onmouseout="hideTip(event, 'fs4', 46)" onmouseover="showTip(event, 'fs4', 46)" class="fn">printfn</span> <span class="s">&quot;</span><span class="pf">%s</span><span class="s">: </span><span class="pf">%s</span><span class="s">&quot;</span> <span onmouseout="hideTip(event, 'fs16', 47)" onmouseover="showTip(event, 'fs16', 47)" class="id">groups</span><span class="pn">.</span><span class="pn">[</span><span class="n">2</span><span class="pn">]</span><span class="pn">.</span><span class="id">Value</span> <span onmouseout="hideTip(event, 'fs16', 48)" onmouseover="showTip(event, 'fs16', 48)" class="id">groups</span><span class="pn">.</span><span class="pn">[</span><span class="n">1</span><span class="pn">]</span><span class="pn">.</span><span class="id">Value</span><span class="pn">)</span>
                           
<span onmouseout="hideTip(event, 'fs4', 49)" onmouseover="showTip(event, 'fs4', 49)" class="fn">printfn</span> <span class="s">&quot;&quot;</span>
<span onmouseout="hideTip(event, 'fs4', 50)" onmouseover="showTip(event, 'fs4', 50)" class="fn">printfn</span> <span class="s">&quot;Found </span><span class="pf">%i</span><span class="s"> trademarks or registered trademarks.&quot;</span> <span onmouseout="hideTip(event, 'fs15', 51)" onmouseover="showTip(event, 'fs15', 51)" class="id">matches</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs17', 52)" onmouseover="showTip(event, 'fs17', 52)" class="id">Length</span>

<span class="c">// &#174;: Microsoft</span>
<span class="c">// &#174;: Excel</span>
<span class="c">// &#174;: Access</span>
<span class="c">// &#174;: Outlook</span>
<span class="c">// &#174;: PowerPoint</span>
<span class="c">// ™: Silverlight</span>
<span class="c">//</span>
<span class="c">// Found 6 trademarks or registered trademarks.</span>
</code></pre></td>
</tr>
</table>
<h3><a name="group-numbers-and-names" class="anchor" href="#group-numbers-and-names">group numbers and names</a></h3>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
<span class="l">20: </span>
<span class="l">21: </span>
<span class="l">22: </span>
<span class="l">23: </span>
<span class="l">24: </span>
<span class="l">25: </span>
<span class="l">26: </span>
<span class="l">27: </span>
<span class="l">28: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span onmouseout="hideTip(event, 'fs18', 53)" onmouseover="showTip(event, 'fs18', 53)" class="id">System</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs19', 54)" onmouseover="showTip(event, 'fs19', 54)" class="id">pattern&#39;&#39;</span> <span class="o">=</span> <span class="s">@&quot;\b((?&lt;word&gt;\w+)\s*)+(?&lt;end&gt;[.?!])&quot;</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs20', 55)" onmouseover="showTip(event, 'fs20', 55)" class="id">input&#39;&#39;</span> <span class="o">=</span> <span class="s">&quot;This is a sentence. This is a second sentence.&quot;</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs21', 56)" onmouseover="showTip(event, 'fs21', 56)" class="id">groupNumbers&#39;</span> <span class="o">=</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">groupNumbers</span> <span onmouseout="hideTip(event, 'fs19', 57)" onmouseover="showTip(event, 'fs19', 57)" class="id">pattern&#39;&#39;</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs22', 58)" onmouseover="showTip(event, 'fs22', 58)" class="id">groupNames</span> <span class="o">=</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">groupNames</span> <span onmouseout="hideTip(event, 'fs19', 59)" onmouseover="showTip(event, 'fs19', 59)" class="id">pattern&#39;&#39;</span>

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs23', 60)" onmouseover="showTip(event, 'fs23', 60)" class="id">m&#39;&#39;</span> <span class="o">=</span> <span class="id">FsRegEx</span><span class="pn">.</span><span class="id">firstMatch</span> <span onmouseout="hideTip(event, 'fs19', 61)" onmouseover="showTip(event, 'fs19', 61)" class="id">pattern&#39;&#39;</span> <span onmouseout="hideTip(event, 'fs20', 62)" onmouseover="showTip(event, 'fs20', 62)" class="id">input&#39;&#39;</span>

<span onmouseout="hideTip(event, 'fs4', 63)" onmouseover="showTip(event, 'fs4', 63)" class="fn">printfn</span> <span class="s">&quot;Match: </span><span class="pf">%s</span><span class="s">&quot;</span> <span onmouseout="hideTip(event, 'fs23', 64)" onmouseover="showTip(event, 'fs23', 64)" class="id">m&#39;&#39;</span><span class="pn">.</span><span class="id">Value</span>

<span onmouseout="hideTip(event, 'fs24', 65)" onmouseover="showTip(event, 'fs24', 65)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs25', 66)" onmouseover="showTip(event, 'fs25', 66)" class="id">zip</span> <span onmouseout="hideTip(event, 'fs21', 67)" onmouseover="showTip(event, 'fs21', 67)" class="id">groupNumbers&#39;</span> <span onmouseout="hideTip(event, 'fs22', 68)" onmouseover="showTip(event, 'fs22', 68)" class="id">groupNames</span>
<span class="o">|&gt;</span> <span onmouseout="hideTip(event, 'fs24', 69)" onmouseover="showTip(event, 'fs24', 69)" class="m">Array</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs13', 70)" onmouseover="showTip(event, 'fs13', 70)" class="id">iter</span> <span class="pn">(</span><span class="k">fun</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs26', 71)" onmouseover="showTip(event, 'fs26', 71)" class="id">n</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs27', 72)" onmouseover="showTip(event, 'fs27', 72)" class="id">name</span><span class="pn">)</span> <span class="k">-&gt;</span>
    <span class="k">let</span> <span onmouseout="hideTip(event, 'fs28', 73)" onmouseover="showTip(event, 'fs28', 73)" class="id">isNumber</span><span class="pn">,</span> <span class="id">_</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs29', 74)" onmouseover="showTip(event, 'fs29', 74)" class="vt">Int32</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs30', 75)" onmouseover="showTip(event, 'fs30', 75)" class="id">TryParse</span><span class="pn">(</span><span onmouseout="hideTip(event, 'fs27', 76)" onmouseover="showTip(event, 'fs27', 76)" class="id">name</span><span class="pn">)</span>
    <span onmouseout="hideTip(event, 'fs4', 77)" onmouseover="showTip(event, 'fs4', 77)" class="fn">printfn</span> <span class="s">&quot;   Group </span><span class="pf">%i</span><span class="s"></span><span class="pf">%s</span><span class="s">: &#39;</span><span class="pf">%s</span><span class="s">&#39;&quot;</span> 
        <span onmouseout="hideTip(event, 'fs26', 78)" onmouseover="showTip(event, 'fs26', 78)" class="id">n</span> 
        <span class="pn">(</span><span class="k">if</span> <span class="pn">(</span><span onmouseout="hideTip(event, 'fs31', 79)" onmouseover="showTip(event, 'fs31', 79)" class="fn">not</span> <span onmouseout="hideTip(event, 'fs28', 80)" onmouseover="showTip(event, 'fs28', 80)" class="id">isNumber</span><span class="pn">)</span> <span class="k">then</span>
            <span class="s">&quot; (&quot;</span> <span class="o">+</span> <span onmouseout="hideTip(event, 'fs27', 81)" onmouseover="showTip(event, 'fs27', 81)" class="id">name</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span>
         <span class="k">else</span> <span onmouseout="hideTip(event, 'fs32', 82)" onmouseover="showTip(event, 'fs32', 82)" class="m">String</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs33', 83)" onmouseover="showTip(event, 'fs33', 83)" class="id">Empty</span><span class="pn">)</span>
        <span class="pn">(</span><span onmouseout="hideTip(event, 'fs12', 84)" onmouseover="showTip(event, 'fs12', 84)" class="id">m&#39;</span><span class="pn">.</span><span class="id">Groups</span><span class="pn">(</span><span class="pn">)</span><span class="pn">)</span><span class="pn">.</span><span class="pn">[</span><span onmouseout="hideTip(event, 'fs26', 85)" onmouseover="showTip(event, 'fs26', 85)" class="id">n</span><span class="pn">]</span><span class="pn">.</span><span class="id">Value</span>
    <span class="pn">)</span>

<span class="c">// Match: This is a sentence.</span>
<span class="c">//    Group 0: &#39;This is a sentence.&#39;</span>
<span class="c">//    Group 1: &#39;sentence&#39;</span>
<span class="c">//    Group 2 (word): &#39;sentence&#39;</span>
<span class="c">//    Group 3 (end): &#39;.&#39;</span>
</code></pre></td>
</tr>
</table>

<div class="tip" id="fs1">val pattern : string</div>
<div class="tip" id="fs2">val input : string</div>
<div class="tip" id="fs3">val m : obj</div>
<div class="tip" id="fs4">val printfn : format:Printf.TextWriterFormat&lt;&#39;T&gt; -&gt; &#39;T</div>
<div class="tip" id="fs5">module Array<br /><br />from Microsoft.FSharp.Collections</div>
<div class="tip" id="fs6">val iteri : action:(int -&gt; &#39;T -&gt; unit) -&gt; array:&#39;T [] -&gt; unit</div>
<div class="tip" id="fs7">val i : int</div>
<div class="tip" id="fs8">val g : obj</div>
<div class="tip" id="fs9">val c : obj</div>
<div class="tip" id="fs10">val pattern&#39; : string</div>
<div class="tip" id="fs11">val input&#39; : string</div>
<div class="tip" id="fs12">val m&#39; : obj</div>
<div class="tip" id="fs13">val iter : action:(&#39;T -&gt; unit) -&gt; array:&#39;T [] -&gt; unit</div>
<div class="tip" id="fs14">val regExpr : string</div>
<div class="tip" id="fs15">val matches : obj []</div>
<div class="tip" id="fs16">val groups : obj</div>
<div class="tip" id="fs17">property System.Array.Length: int</div>
<div class="tip" id="fs18">namespace System</div>
<div class="tip" id="fs19">val pattern&#39;&#39; : string</div>
<div class="tip" id="fs20">val input&#39;&#39; : string</div>
<div class="tip" id="fs21">val groupNumbers&#39; : int []</div>
<div class="tip" id="fs22">val groupNames : string []</div>
<div class="tip" id="fs23">val m&#39;&#39; : obj</div>
<div class="tip" id="fs24">type Array =<br />&#160;&#160;member Clone : unit -&gt; obj<br />&#160;&#160;member CopyTo : array:Array * index:int -&gt; unit + 1 overload<br />&#160;&#160;member GetEnumerator : unit -&gt; IEnumerator<br />&#160;&#160;member GetLength : dimension:int -&gt; int<br />&#160;&#160;member GetLongLength : dimension:int -&gt; int64<br />&#160;&#160;member GetLowerBound : dimension:int -&gt; int<br />&#160;&#160;member GetUpperBound : dimension:int -&gt; int<br />&#160;&#160;member GetValue : [&lt;ParamArray&gt;] indices:int[] -&gt; obj + 7 overloads<br />&#160;&#160;member Initialize : unit -&gt; unit<br />&#160;&#160;member IsFixedSize : bool<br />&#160;&#160;...</div>
<div class="tip" id="fs25">val zip : array1:&#39;T1 [] -&gt; array2:&#39;T2 [] -&gt; (&#39;T1 * &#39;T2) []</div>
<div class="tip" id="fs26">val n : int</div>
<div class="tip" id="fs27">val name : string</div>
<div class="tip" id="fs28">val isNumber : bool</div>
<div class="tip" id="fs29">type Int32 =<br />&#160;&#160;struct<br />&#160;&#160;&#160;&#160;member CompareTo : value:obj -&gt; int + 1 overload<br />&#160;&#160;&#160;&#160;member Equals : obj:obj -&gt; bool + 1 overload<br />&#160;&#160;&#160;&#160;member GetHashCode : unit -&gt; int<br />&#160;&#160;&#160;&#160;member GetTypeCode : unit -&gt; TypeCode<br />&#160;&#160;&#160;&#160;member ToString : unit -&gt; string + 3 overloads<br />&#160;&#160;&#160;&#160;static val MaxValue : int<br />&#160;&#160;&#160;&#160;static val MinValue : int<br />&#160;&#160;&#160;&#160;static member Parse : s:string -&gt; int + 3 overloads<br />&#160;&#160;&#160;&#160;static member TryParse : s:string * result:int -&gt; bool + 1 overload<br />&#160;&#160;end</div>
<div class="tip" id="fs30">Int32.TryParse(s: string, result: byref&lt;int&gt;) : bool<br />Int32.TryParse(s: string, style: Globalization.NumberStyles, provider: IFormatProvider, result: byref&lt;int&gt;) : bool</div>
<div class="tip" id="fs31">val not : value:bool -&gt; bool</div>
<div class="tip" id="fs32">Multiple items<br />type String =<br />&#160;&#160;new : value:char -&gt; string + 7 overloads<br />&#160;&#160;member Chars : int -&gt; char<br />&#160;&#160;member Clone : unit -&gt; obj<br />&#160;&#160;member CompareTo : value:obj -&gt; int + 1 overload<br />&#160;&#160;member Contains : value:string -&gt; bool<br />&#160;&#160;member CopyTo : sourceIndex:int * destination:char[] * destinationIndex:int * count:int -&gt; unit<br />&#160;&#160;member EndsWith : value:string -&gt; bool + 2 overloads<br />&#160;&#160;member Equals : obj:obj -&gt; bool + 2 overloads<br />&#160;&#160;member GetEnumerator : unit -&gt; CharEnumerator<br />&#160;&#160;member GetHashCode : unit -&gt; int<br />&#160;&#160;...<br /><br />--------------------<br />String(value: nativeptr&lt;char&gt;) : String<br />String(value: nativeptr&lt;sbyte&gt;) : String<br />String(value: char []) : String<br />String(c: char, count: int) : String<br />String(value: nativeptr&lt;char&gt;, startIndex: int, length: int) : String<br />String(value: nativeptr&lt;sbyte&gt;, startIndex: int, length: int) : String<br />String(value: char [], startIndex: int, length: int) : String<br />String(value: nativeptr&lt;sbyte&gt;, startIndex: int, length: int, enc: Text.Encoding) : String</div>
<div class="tip" id="fs33">field string.Empty: string</div>

        </div>
        <div class="span3">
          <img src="/FsRegEx/img/logo.png" alt="F# Project" style="width:150px;margin:10px" />  
            <ul class="nav nav-list" id="menu" style="margin-top: 20px;">
                <li class="nav-header">FsRegEx</li>
                <li><a href="/FsRegEx/index.html">Home page</a></li>
                <li class="divider"></li>
                <li><a href="http://nuget.org/packages/FsRegEx">Get Library via NuGet</a></li>
                <li><a href="https://github.com/jackfoxy/FsRegEx">Source Code on GitHub</a></li>
                <li><a href="/FsRegEx/license.html">License</a></li>
                <li><a href="/FsRegEx/release-notes.html">Release Notes</a></li>

                <li class="nav-header">Examples</li>
                <li><a href="/FsRegEx/matching.html">Matching</a></li>
                <li><a href="/FsRegEx/group.html">Match Groups</a></li>
                <li><a href="/FsRegEx/replacesplit.html">Replace and Split</a></li>
                <li><a href="/FsRegEx/capture.html">Capture</a></li>

                <li class="nav-header">Documentation</li>
                <li><a href="/FsRegEx/reference/index.html">API Reference</a></li>

                <li class="nav-header">More...</li>
                <li><a href="/FsRegEx/emailregex.html">On the Futility of Email Regex Validation</a></li>
                <li><a href="/FsRegEx/tutorial.html">F# Verbal Expressions Tutorial</a></li>
            </ul>
        </div>
      </div>
    </div>
    <a href="https://github.com/jackfoxy/FsRegEx"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"/></a>
  </body>
  </html>
