Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 22, 2010
1 parent b68473a commit 0111582
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/guide.1
Expand Up @@ -176,14 +176,14 @@ A route is simple a string which is compiled to a \fIRegExp\fR internally\. For
.IP "" 0
.
.P
Regular expression literals may also be passed for complex uses\. Since capture groups with literal \fIRegExp\fR\'s are anonymous we use the \fIparams\.captures\fR array\.
Regular expression literals may also be passed for complex uses\. Since capture groups with literal \fIRegExp\fR\'s are anonymous we can access them directly from the \fIparams\fR array\.
.
.IP "" 4
.
.nf

app\.get(/^\\/users?(?:\\/(\\d+)(?:\\\.\\\.(\\d+))?)?/, function(req, res, params){
res\.send(params\.captures);
res\.send(params);
});
.
.fi
Expand Down
4 changes: 2 additions & 2 deletions docs/guide.html
Expand Up @@ -340,10 +340,10 @@ <h3 id="Routing">Routing</h3>
</code></pre>

<p>Regular expression literals may also be passed for complex uses. Since capture
groups with literal <em>RegExp</em>'s are anonymous we use the <em>params.captures</em> array.</p>
groups with literal <em>RegExp</em>'s are anonymous we can access them directly from the <em>params</em> array.</p>

<pre><code>app.get(/^\/users?(?:\/(\d+)(?:\.\.(\d+))?)?/, function(req, res, params){
res.send(params.captures);
res.send(params);
});
</code></pre>

Expand Down
4 changes: 2 additions & 2 deletions docs/guide.md
Expand Up @@ -101,10 +101,10 @@ when _/user/:id_ is compiled, a simplified version of the regexp may look simila
\/user\/([^\/]+)\/?

Regular expression literals may also be passed for complex uses. Since capture
groups with literal _RegExp_'s are anonymous we use the _params.captures_ array.
groups with literal _RegExp_'s are anonymous we can access them directly from the _params_ array.

app.get(/^\/users?(?:\/(\d+)(?:\.\.(\d+))?)?/, function(req, res, params){
res.send(params.captures);
res.send(params);
});

Curl requests against the previously defined route:
Expand Down

0 comments on commit 0111582

Please sign in to comment.