my $l = $r->route ('/:lang', lang => qr/(en|se|fi)/ );
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.
$r->route('/:name', name => qr/\[a-zA-Z]+/)
Building complicated regular expressions can be tricky, make sure to use "./script/myapp routes" to look at the final result.
I can confirm this behaviour on Ubuntu 10.04, perl-5.10.1, mojo-1.11
It looks like mojolicious is trying to interpolate %E in %E4 (ä) in
the capturing regex.
----- contents of 'Test' --------
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/(*capture)' => sub {
my $self = shift;
$self->render( text => $self->stash('capture'). "\n" );
};
app->start;
__DATA__
@@ not_found.html.ep
Not Found!
----------
bash> for url in /simple /aaa%3Fbbb /aaaäbbb /aaa%E4bbb; do echo GET
$url; ./Test --mode=deployment GET $url; done
GET /simple
simple
GET /aaa%3Fbbb
aaa?bbb
GET /aaaäbbb
aaaäbbb
GET /aaa%E4bbb
Use of uninitialized value in pattern match (m//) at
/home/alister/perl5/lib/perl5/Mojolicious/Routes/Pattern.pm line 121.
Use of uninitialized value in substitution (s///) at
/home/alister/perl5/lib/perl5/Mojolicious/Routes/Pattern.pm line 124.
Use of uninitialized value in substitution (s///) at
/home/alister/perl5/lib/perl5/Mojolicious/Routes/Pattern.pm line 124.
Not Found!
~~
c|_| alisterwest.com - mmm coffee!
https://github.com/kraih/mojo/commit/15af26469be4045630b711e40fa8154916beaa70