1 package Catalyst::DispatchType::Regex;
4 use base qw/Catalyst::DispatchType/;
7 my ($self, $c, $path) = @_;
9 if ( my $action = $self->{paths}->{$path} ) {
10 $c->req->action($path);
11 $c->req->match($path);
13 $c->namespace($action->prefix);
17 foreach my $compiled (@{$self->{compiled}||[]}) {
18 if ( my @snippets = ( $path =~ $compiled->{re} ) ) {
19 $c->req->action($compiled->{path});
20 $c->req->match($path);
21 $c->req->snippets(\@snippets);
22 $c->action($compiled->{action});
23 $c->namespace($compiled->{action}->prefix);
32 my ( $self, $c, $action ) = @_;
33 my $attrs = $action->attributes;
34 my @register = map { @{$_ || []} } @{$attrs}{'Regex', 'Regexp'};
35 foreach my $r (@register) {
36 $self->{paths}{$r} = $action;
37 push(@{$self->{compiled}},