Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Support regex in prefix

Open 17dec opened this issue 7 years ago • 0 comments

This would allow for additional input validation to be done directly in the route, which is not possible with plain route parameters. E.g.

prefix qr{/user/(?<user>[a-z0-9]{3,16})}, sub {
  get '/page' => sub {
    my $user = captures->{user};
  }
};
# Should match: /user/17dec/page
# Fails to match: /user/CAPI-TALS/page

17dec avatar Dec 03 '17 15:12 17dec