Skip to content

Commit

Permalink
small documentation tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 16, 2012
1 parent 7163f17 commit ff3d6a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -125,7 +125,7 @@ characters except C</>.
=head2 Wildcard placeholders

Wildcard placeholders are just like the two placeholders above, but match
absolutely everything.
absolutely everything, including C</> and C<.>.

/hello -> /*name/hello -> undef
/sebastian/23/hello -> /*name/hello -> {name => 'sebastian/23'}
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Routes/Pattern.pm
Expand Up @@ -168,13 +168,13 @@ sub _compile_format {

# Default regex
my $reqs = $self->reqs;
return $self->format(qr#\.([^/]+)#)->format
return $self->format(qr#\.([^/]+)$#)->format
if !exists $reqs->{format} && $reqs->{format};

# Compile custom regex
my $regex =
defined $reqs->{format} ? _compile_req($reqs->{format}) : '([^/]+)';
return $self->format(qr#\.$regex#)->format;
return $self->format(qr#\.$regex$#)->format;
}

# "Interesting... Oh no wait, the other thing, tedious."
Expand Down

0 comments on commit ff3d6a9

Please sign in to comment.